Nginx editing php.ini changes no reflecting
Solution 1
Have you tried to put your php.ini under /etc/php5/fpm/php.ini? This is normally the default location that php reads from, if I understand php5-fpm correctly.
Solution 2
You need to restart it. I use 7.0 so change the 7.0 to your version.
sudo systemctl restart php7.0-fpm
Solution 3
I have the same problem in Centos 7 I used nginx as the webserver. I restared php-fpm service and my problem solved. the reason is nginx use php-fpm service for handling php the only way to reflect your changes is restart php-fpm service.
you need to run systemctl restart php-fpm
Related videos on Youtube
![Case](https://i.stack.imgur.com/9jKSA.png?s=256&g=1)
Case
Updated on September 18, 2022Comments
-
Case almost 2 years
phpinfo says the file location is
/etc/php5/fpm/php.ini
.Additional
.ini
files parsed/etc/php5/fpm/conf.d/curl.ini, /etc/php5/fpm/conf.d/gd.ini, /etc/php5/fpm/conf.d/mcrypt.ini, /etc/php5/fpm/conf.d/mysql.ini, /etc/php5/fpm/conf.d/mysqli.ini, /etc/php5/fpm/conf.d/pdo.ini, /etc/php5/fpm/conf.d/pdo_mysql.ini, /etc/php5/fpm/conf.d/xcache.ini
Looking in them none of them have anything that deals with
post_max_filesize
orupload_max_filesize
.I edit this in the
php.ini
file and restart both the nginx and php5-fpm service. The changes do not happen. The files are still edited. I have tried rebooting the computer.Does NGINX cache this somewhere that I need to delete in order for these changes to be made live?
I have tried
php -i | grep ".ini"
and it tells me the path for
php.ini is Path => /etc/php5/cli/
The phpinfo() tells me its
/etc/php5/fpm/
I have edited both with no luck.
if I do
php -i | grep "post_max"
it tells me its 20M, phpinfo still says 8M.-
Jorge Orpinel Pérez over 8 years"I have tried php -i | grep ".ini" and it tells me the path for php.ini is /etc/php5/cli/ The phpinfo() tells me its /etc/php5/fpm/" This is because phpinfo() is executed by the web server via FPM. When you run php from terminal you're using CLI (by definition).
-
-
Case over 11 yearsThat's where it is located at. The changes to it are not happening.
-
Danie over 11 yearsDo you perhaps have logs for php5-fpm? Is there nothing in your error logs?
-
Case over 11 yearsNothing useful, just that it was reloaded over and over again when I was trying to fix the problem.
-
Case over 11 yearsThere was ntohing in the logs, but I did find serverfault.com/questions/450460/…
-
Allen Gingrich about 6 yearsThis worked for me when the other answer didn't.
-
FiftiN about 3 yearsWorks to me, after changing /etc/php/7.x/fpm/php.ini
-
Community over 2 yearsYour answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.