LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   php.ini:upload_max_filesize reverts to default when error_reporting = All (https://www.linuxquestions.org/questions/linux-server-73/php-ini-upload_max_filesize-reverts-to-default-when-error_reporting-%3D-all-890619/)

geokker 07-08-2011 11:29 AM

php.ini:upload_max_filesize reverts to default when error_reporting = All
 
I have a bizarre problem with my php5 system php.ini file. I have these relevant directives set:

Code:

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
upload_max_filesize = 13M

when I call phpinfo(), it reports the PHP default max upload size of 2M

If I comment out error_reporting, it works i.e. 13M is reported.

What gives?

I need to suppress the errors. Can I change the default from 2M perhaps?

j-ray 07-10-2011 04:54 AM

Erase the ";" in the first line and use the = assignment instead of the function call
error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED

I guess that could help...

geokker 07-10-2011 08:09 AM

No, that didn't work I'm afraid. I think I've tried every permutation. I don't understand the link between the error_reporting directive and reading php.ini. If I completely comment out the line, php.ini is fine.

j-ray 07-11-2011 02:10 AM

the error_reporting directive must not stand there as a function call with an endening ";". It is not a php script but an ini file. Did you restart the server after making the changes in php.ini?

geokker 07-11-2011 10:39 AM

Yes, I restart Apache every change.

Code:

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);
Blocks php.ini (or reverts to defaults) but enables the code.

Code:

error_reporting = E_ALL & ~E_NOTICE & ~E_DEPRECATED
Enables changes to php.ini but blows up the code.

So, presumably, leaving error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED); in makes the php.ini file unreadable. This is simply a syntax error and the code is at fault.

The weird thing is that commenting out all references to error_reporting blows up the code.


All times are GMT -5. The time now is 06:49 PM.