The upload_max_filesize is set to 2 MB and I am having issues changing it. I am used to changing such settings in a php.ini file, however, I was unable to find such file on my server. I assume FastCGI does not have such a file?

I was able to find the following file /etc/php5/fpm/php.ini however, changing this did not affect my upload limit in phpMyAdmin. I read somewhere that you can enter php configuration details directly into the nginx.conf file but I'm not entirely sure if that's correct or how that works...

Any guidance is greatly appreciated!

  • Did you restart PHP? – Michael Hampton Mar 27 '17 at 7:45
  • On Amazon Linux (similar to centos) it's /etc/php.ini . Best thing to do is create a file that calls the phpinfo(), view that page, which will tell you what its configuration file is : mediatemple.net/community/products/dv/204643880/… – Tim Mar 27 '17 at 8:11
  • Are you sure that you do not have anything in /etc/php5/apache/? – Orphans Mar 27 '17 at 9:38

A you can have multiple php.ini files for one system. So you must identify the correct one at first. For your system you have one php.ini file for the PHP-FPM daemon (here: /etc/php5/fpm/php.ini) and one php.ini file for CLI (here: /etc/php5/cli/php.ini).

The PHP-FPM daemon is a dedicated server accessed by your web server via Fast-CGI interface and executing PHP scripts. This is the way Nginx handles PHP. Nginx does not have a mod_php like Apache has.

The CLI stands for Command-Line-Interface and means everything you do with PHP from your command line (e.g. cron-Scripts). It makes sense to allow different settings (e.g. no time limitation, no memory limitation). Therefor you have a different configuration.

After you have changed your php.ini for the PHP-FPM you must reload or restart the PHP-FPM daemon to take effect.

Debian Jessie:

sudo systemctl reload php5-fpm


sudo service reload php5-fpm

After you have changed your php.ini for the CLI it will be used the next time you will execute PHP on command line or in Cron.

  • Thank you for your answer! I thought PHP-FPM and Fast-CGI were two competing entities... evidently not :) – Oliver Chalk Mar 28 '17 at 8:15

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.