phpinfo says the file location is /etc/php5/fpm/php.ini.

Additional .ini files parsed


Looking in them none of them have anything that deals with post_max_filesize or upload_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.

  • "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). – Jorge Orpinel Nov 3 '15 at 19:38

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.

  • That's where it is located at. The changes to it are not happening. – Case Nov 20 '12 at 6:44
  • Do you perhaps have logs for php5-fpm? Is there nothing in your error logs? – Danie Nov 20 '12 at 7:47
  • Nothing useful, just that it was reloaded over and over again when I was trying to fix the problem. – Case Nov 20 '12 at 11:54
  • 1
    There was ntohing in the logs, but I did find serverfault.com/questions/450460/… – Case Nov 20 '12 at 12:07

You need to restart it. I use 7.0 so change the 7.0 to your version.

sudo systemctl restart php7.0-fpm
  • 2
    This worked for me when the other answer didn't. – Allen Gingrich Apr 3 '18 at 4:30
  • 1
    Works to me, after changing /etc/php/7.x/fpm/php.ini – FiftiN Apr 28 at 19:20

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


For me (using CentOS) I had to do the following to take effect of php.ini change:

systemctl restart httpd.service

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.