I’ve see a few other similar questions on here, but most of the answers are Apache specific (dealing with their .htaccess file) and I’m using nginx.
I’m having trouble making my change to the upload_max_filesize
in php.ini stick. I’m using nginx, php5 and wordpress on Debian.
When I run phpinfo() I see the following output:
Loaded Configuration File /etc/php5/cgi/php.ini
I then go to the relevant .ini file, change a few values, and then restart nginx. When I fire up a phpinfo() plugin I got for wordpress, it reports the values as unchanged.
I’m at a loss because phpinfo() reports that it is loading config values from the file that I’ve changed, but it doesn’t report the changes.
You might be using FAST CGI:
If you restart the webserver, PHP is not restarted, so still has the old ini values because it didn’t reload the ini file.
Restarting the fcgi daemon solves that issue, PHP will be restarted, re-reading the ini.
Some fcgi daemons have a command that reloads the child processes more gracefully. Depends on what you use.
For me the problem was a syntax error in the custom php.ini file, which I found after checking the error logs.
This might help the ones that are using
php -i
from the terminal to checkphp.ini
settings.In my case, I increased the
upload_max_filesize
from 2M to 20 MB by editing/etc/php/7.3/apache2/php.ini
and restarted the apache byapachectl restart
command.I used
php -i
command from the Debian terminal to see the changes are in effect butupload_max_filesize
was still 2M.Then I realized settings readings came from
/etc/php/7.3/cli/php.ini
because I was usingphp -i
from the terminal instead ofphpinfo()
function in a web page.Resolved my problem. change the php version to the one you using.