I encountered an weird problem this afternoon, after i modified the upload_max_filesize option to 4M in php.ini, and restarted php-fpm, the phpinfo function still output upload_max_filesize as 2M, so the modification did not take into effect.
The following steps were what i did:
- modify the upload_max_filesize to 4M in php.ini
- restart php-fpm service
- verify that the modified php.ini is the loaded configuration of php-fpm.
- check phpinfo(), the upload_max_filesize is still 2M
After some searching and browsing on the internet, i found a valid solution that worked for this weird problem,
fastcgi_param PHP_VALUE "upload_max_filesize=4M";
After adding the above item into .php${} block, and reloading nginx, it worked.
So maybe next time when you change an option of php.ini but it does not work, take the above solution into consideration. It is amazing~