php.ini altered after custombuild recompile

mrdave

Verified User
Joined
Nov 23, 2011
Messages
13
There are a couple of lines in custombuild that changes php.ini if you have php 5.3 installed after a php recompile:

if [ "${PHP5_VER_OPT}" = "5.3" ]; then
/usr/bin/perl -pi -e 's/^register_long_arrays/;register_long_arrays/' ${PHP_INI}
/usr/bin/perl -pi -e 's/^magic_quotes_gpc/;magic_quotes_gpc/' ${PHP_INI}
...

These two lines comment out register_long_arrays and magic_quotes_gpc directives from php.ini, since I need to have these turned off for my server, after a recompile I end up having magic_quotes_gpc and register_long_arrays enabled since these are stll default to on on php 5.3

Please remove these two lines of code from custombuild script or at least give an option somewhere to not alter php.ini if one do not wants to.
 
Actually those two line make comment, so, as far as i understand, should just disable those two function.

Am i wrong?

Regards
 
Actually those two line make comment, so, as far as i understand, should just disable those two function.

The problem is that if the lines are commented out, the default value for these options will be 'ON', and ends up having magic_quotes_gpc enabled for the server. These should NOT be commented out to have magic_quotes_gpc and register_long_arrays disabled on php (the recommended config tells to have these disabled), and all my websites relies on these to be disabled.
 
There are a couple of lines in custombuild that changes php.ini if you have php 5.3 installed after a php recompile:

if [ "${PHP5_VER_OPT}" = "5.3" ]; then
/usr/bin/perl -pi -e 's/^register_long_arrays/;register_long_arrays/' ${PHP_INI}
/usr/bin/perl -pi -e 's/^magic_quotes_gpc/;magic_quotes_gpc/' ${PHP_INI}
...

These two lines comment out register_long_arrays and magic_quotes_gpc directives from php.ini, since I need to have these turned off for my server, after a recompile I end up having magic_quotes_gpc and register_long_arrays enabled since these are stll default to on on php 5.3

Please remove these two lines of code from custombuild script or at least give an option somewhere to not alter php.ini if one do not wants to.

You cannot have these directives in php.ini file, because they are deprecated in PHP 5.3. http://php.net/manual/en/migration53.deprecated.php
 
You cannot have these directives in php.ini file, because they are deprecated in PHP 5.3. http://php.net/manual/en/migration53.deprecated.php

Read this:
http://php.net/manual/en/info.configuration.php

last lines
---
Caution: Although magic_quotes_gpc is flagged as dreprecated the default value is still "ON". So you will explicitly have to put

magic_quotes_gpc = Off

into your php.ini. Commeting out the magic_quotes_gpc-line will not turn magic_quotes_gpc off.
---

I think it's better to get an E_DEPRECATED erorr (that by default goes to error_log and is not displayed), instead of having your code broken because a php.ini directive is unknownly changed.
 
Read this:
http://php.net/manual/en/info.configuration.php

last lines
---
Caution: Although magic_quotes_gpc is flagged as dreprecated the default value is still "ON". So you will explicitly have to put

magic_quotes_gpc = Off

into your php.ini. Commeting out the magic_quotes_gpc-line will not turn magic_quotes_gpc off.
---

I think it's better to get an E_DEPRECATED erorr (that by default goes to error_log and is not displayed), instead of having your code broken because a php.ini directive is unknownly changed.

Isn't it better to use a .htaccess file for it?
Code:
php_flag  magic_quotes_gpc off

We would not like to use deprecated directives in php.ini file.
 
I had the same problem after rebuilding / upgrading PHP and Apache.

My fix was to re-edit the php.ini file after rebuilding (/usr/local/lib/php/php.ini) or use the Admin's File Editor and select it from the pulldown list.

Be sure to restart Apache. That's it!
 
Back
Top