]> git.pld-linux.org Git - packages/php.git/blob - php-ini.patch
- variables_order = "EGPCS" -> "GPCS" (performance)
[packages/php.git] / php-ini.patch
1 --- php-5.1.6/php.ini~  2006-09-26 12:52:32.871369095 +0300
2 +++ php-5.1.6/php.ini   2006-09-26 12:50:19.858375000 +0300
3 @@ -3,13 +3,18 @@
4  ;;;;;;;;;;;
5  ; WARNING ;
6  ;;;;;;;;;;;
7 -; This is the default settings file for new PHP installations.
8 -; By default, PHP installs itself with a configuration suitable for
9 -; development purposes, and *NOT* for production purposes.
10 -; For several security-oriented considerations that should be taken
11 -; before going online with your site, please consult php.ini-recommended
12 -; and http://php.net/manual/en/security.php.
13 -
14 +; This is the default settings file for new PHP installations from
15 +; PLD Linux Distribution.
16 +; It's based mainly on php.ini-dist, but with some changes made with
17 +; security in mind (see below, consult also
18 +; http://php.net/manual/en/security.php).
19 +;
20 +; Please note, that in PLD installations /etc/php/php.ini file
21 +; contains global settings for all SAPIs (cgi, cli, apache...),
22 +; and after reading this file, SAPI-specific file (/etc/php/php-cgi.ini,
23 +; /etc/php/php-cli.ini, /etc/php/php-apache.ini...) is INCLUDED
24 +; (so you don't have to duplicate whole large file to override only
25 +; few options)
26  
27  ;;;;;;;;;;;;;;;;;;;
28  ; About php.ini   ;
29 @@ -59,10 +64,72 @@
30  ;;;;;;;;;;;;;;;;;;;
31  ; About this file ;
32  ;;;;;;;;;;;;;;;;;;;
33 -; All the values in the php.ini-dist file correspond to the builtin
34 -; defaults (that is, if no php.ini is used, or if you delete these lines,
35 -; the builtin defaults will be identical).
36 +; If you use constants in your value, and these constants belong to a
37 +; dynamically loaded extension (either a PHP extension or a Zend extension),
38 +; you may only use these constants *after* the line that loads the extension.
39 +
40  
41 +; Below is the list of settings changed from default as specified in
42 +; php.ini-recommended. These settings make PHP more secure and encourage
43 +; cleaner coding.
44 +; The price is that with these settings, PHP may be incompatible with some old
45 +; or bad-written applications, and sometimes, more difficult to develop with.
46 +; Using this settings is warmly recommended for production sites.  As all of
47 +; the changes from the standard settings are thoroughly documented, you can
48 +; go over each one, and decide whether you want to use it or not.
49 +;
50 +; - register_globals = Off         [Security, Performance]
51 +;     Global variables are no longer registered for input data (POST, GET, cookies,
52 +;     environment and other server variables).  Instead of using $foo, you must use
53 +;     you can use $_REQUEST["foo"] (includes any variable that arrives through the
54 +;     request, namely, POST, GET and cookie variables), or use one of the specific
55 +;     $_GET["foo"], $_POST["foo"], $_COOKIE["foo"] or $_FILES["foo"], depending
56 +;     on where the input originates.  Also, you can look at the
57 +;     import_request_variables() function.
58 +;     Note that register_globals = Off is the default setting since PHP 4.2.0.
59 +; - display_errors = Off           [Security]
60 +;     With this directive set to off, errors that occur during the execution of
61 +;     scripts will no longer be displayed as a part of the script output, and thus,
62 +;     will no longer be exposed to remote users.  With some errors, the error message
63 +;     content may expose information about your script, web server, or database
64 +;     server that may be exploitable for hacking.  Production sites should have this
65 +;     directive set to off.
66 +; - log_errors = On                [Security]
67 +;     This directive complements the above one.  Any errors that occur during the
68 +;     execution of your script will be logged (typically, to your server's error log,
69 +;     but can be configured in several ways).  Along with setting display_errors to off,
70 +;     this setup gives you the ability to fully understand what may have gone wrong,
71 +;     without exposing any sensitive information to remote users.
72 +; - error_reporting = E_ALL        [Code Cleanliness, Security(?)]
73 +;     By default, PHP surpresses errors of type E_NOTICE.  These error messages
74 +;     are emitted for non-critical errors, but that could be a symptom of a bigger
75 +;     problem.  Most notably, this will cause error messages about the use
76 +;     of uninitialized variables to be displayed.
77 +; - register_argc_argv = Off       [Performance]
78 +;     Disables registration of the somewhat redundant $argv and $argc global
79 +;     variables.
80 +; - magic_quotes_gpc = Off         [Performance]
81 +;     Input data is no longer escaped with slashes so that it can be sent into
82 +;     SQL databases without further manipulation.  Instead, you should use the
83 +;     function addslashes() on each input element you wish to send to a database.
84 +; - variables_order = "GPCS"       [Performance]
85 +;     The environment variables are not hashed into the $HTTP_ENV_VARS[].  To access
86 +;     environment variables, you can use getenv() instead.
87 +
88 +; For completeness, below is list of the rest of changes recommended for
89 +; performance, but NOT applied in default php.ini in PLD (since they are
90 +; not needed for security or may cause problems with some applications
91 +; more likely than above).
92 +
93 +; - output_buffering = 4096        [Performance]
94 +;     Set a 4KB output buffer.  Enabling output buffering typically results in less
95 +;     writes, and sometimes less packets sent on the wire, which can often lead to
96 +;     better performance.  The gain this directive actually yields greatly depends
97 +;     on which Web server you're working with, and what kind of scripts you're using.
98 +; - allow_call_time_pass_reference = Off     [Code cleanliness]
99 +;     It's not possible to decide to force a variable to be passed by reference
100 +;     when calling a function.  The PHP 4 style to do this is by making the
101 +;     function require the relevant argument by reference.
102  
103  ;;;;;;;;;;;;;;;;;;;;
104  ; Language Options ;
105 @@ -86,7 +153,7 @@
106  asp_tags = Off
107  
108  ; The number of significant digits displayed in floating point numbers.
109 -precision    =  12
110 +precision    =  14
111  
112  ; Enforce year 2000 compliance (will cause problems with non-compliant browsers)
113  y2k_compliance = On
114 @@ -299,14 +366,16 @@
115  ;
116  ;   - Show all errors except for notices and coding standards warnings
117  ;
118 -error_reporting  =  E_ALL & ~E_NOTICE
119 +;error_reporting  =  E_ALL & ~E_NOTICE
120 +
121 +error_reporting = E_ALL
122  
123  ; Print out errors (as a part of the output).  For production web sites,
124  ; you're strongly encouraged to turn this feature off, and use error logging
125  ; instead (see below).  Keeping display_errors enabled on a production web site
126  ; may reveal security information to end users, such as file paths on your Web
127  ; server, your database schema or other information.
128 -display_errors = On
129 +display_errors = Off
130  
131  ; Even when display_errors is on, errors that occur during PHP's startup
132  ; sequence are not displayed.  It's strongly recommended to keep
133 @@ -316,7 +385,7 @@
134  ; Log errors into a log file (server-specific log, stderr, or error_log (below))
135  ; As stated above, you're strongly advised to use error logging in place of
136  ; error displaying on production web sites.
137 -log_errors = Off
138 +log_errors = On
139  
140  ; Set maximum length of log_errors. In error_log information about the source is
141  ; added. The default is 1024 and 0 allows to not apply any maximum length at all.
142 @@ -385,7 +454,7 @@
143  ; Environment and Built-in variables (G, P, C, E & S respectively, often
144  ; referred to as EGPCS or GPC).  Registration is done from left to right, newer
145  ; values override older values.
146 -variables_order = "EGPCS"
147 +variables_order = "GPCS"
148  
149  ; Whether or not to register the EGPCS variables as global variables.  You may
150  ; want to turn this off if you don't want to clutter your scripts' global scope
151 @@ -401,12 +470,12 @@
152  ; Whether or not to register the old-style input arrays, HTTP_GET_VARS
153  ; and friends.  If you're not using them, it's recommended to turn them off,
154  ; for performance reasons.
155 -register_long_arrays = On
156 +register_long_arrays = Off
157  
158  ; This directive tells PHP whether to declare the argv&argc variables (that
159  ; would contain the GET information).  If you don't use these variables, you
160  ; should turn it off for increased performance.
161 -register_argc_argv = On
162 +register_argc_argv = Off
163  
164  ; When enabled, the SERVER and ENV variables are created when they're first
165  ; used (Just In Time) instead of when the script starts. If these variables
166 @@ -422,7 +491,7 @@
167  ;
168  
169  ; Magic quotes for incoming GET/POST/Cookie data.
170 -magic_quotes_gpc = On
171 +magic_quotes_gpc = Off
172  
173  ; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
174  magic_quotes_runtime = Off
175 @@ -468,7 +537,7 @@
176  user_dir =
177  
178  ; Directory in which the loadable extensions (modules) reside.
179 -extension_dir = "./"
180 +extension_dir = "/usr/lib/php"
181  
182  ; Whether or not to enable the dl() function.  The dl() function does NOT work
183  ; properly in multithreaded servers, such as IIS or Zeus, and is automatically
184 @@ -529,7 +598,7 @@
185  ;;;;;;;;;;;;;;;;;;
186  
187  ; Whether to allow the treatment of URLs (like http:// or ftp://) as files.
188 -allow_url_fopen = On
189 +allow_url_fopen = Off
190  
191  ; Define the anonymous ftp password (your email address)
192  ;from="john@doe.com"
193 @@ -569,48 +638,6 @@
194  ; needs to go here.  Specify the location of the extension with the
195  ; extension_dir directive above.
196  
197 -
198 -; Windows Extensions
199 -; Note that ODBC support is built in, so no dll is needed for it.
200 -; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
201 -; extension folders as well as the separate PECL DLL download (PHP 5).
202 -; Be sure to appropriately set the extension_dir directive.
203 -
204 -;extension=php_mbstring.dll
205 -;extension=php_bz2.dll
206 -;extension=php_curl.dll
207 -;extension=php_dba.dll
208 -;extension=php_dbase.dll
209 -;extension=php_exif.dll
210 -;extension=php_fdf.dll
211 -;extension=php_filepro.dll
212 -;extension=php_gd2.dll
213 -;extension=php_gettext.dll
214 -;extension=php_ifx.dll
215 -;extension=php_imap.dll
216 -;extension=php_interbase.dll
217 -;extension=php_ldap.dll
218 -;extension=php_mcrypt.dll
219 -;extension=php_mhash.dll
220 -;extension=php_mime_magic.dll
221 -;extension=php_ming.dll
222 -;extension=php_mssql.dll
223 -;extension=php_msql.dll
224 -;extension=php_mysql.dll
225 -;extension=php_oci8.dll
226 -;extension=php_openssl.dll
227 -;extension=php_oracle.dll
228 -;extension=php_pgsql.dll
229 -;extension=php_shmop.dll
230 -;extension=php_snmp.dll
231 -;extension=php_sockets.dll
232 -;extension=php_sqlite.dll
233 -;extension=php_sybase_ct.dll
234 -;extension=php_tidy.dll
235 -;extension=php_xmlrpc.dll
236 -;extension=php_xsl.dll
237 -
238 -
239  ;;;;;;;;;;;;;;;;;;;
240  ; Module Settings ;
241  ;;;;;;;;;;;;;;;;;;;
242 @@ -1193,7 +1220,7 @@
243  ; Enables or disables WSDL caching feature.
244  soap.wsdl_cache_enabled=1
245  ; Sets the directory name where SOAP extension will put cache files.
246 -soap.wsdl_cache_dir="/tmp"
247 +soap.wsdl_cache_dir="/var/run/php"
248  ; (time to live) Sets the number of second while cached file will be used 
249  ; instead of original one.
250  soap.wsdl_cache_ttl=86400
This page took 0.043697 seconds and 4 git commands to generate.