I have been trying for two days to increase the max filesize for file uploads via php to 10M from the default 2M. I change the php.ini file that is referenced by phpinfo to no avail.
I saw a few articles stating that there is a syntax error around line 109 of the php.ini file, but I don't know what the syntax error is or how to correct it. users stated that because the upload_max_filesize is AFTER this error in the config file it is being ignored. Please help.
PHP-FPM you need to restart to avoid configuration inconsistency. Some workers will lay dormant and keep the old configuration, while new workers will get the new configuration.
The upload_max_filesize directive itself is located in the php. ini file, which is the default server configuration file for applications that require PHP. Those two things – upload_max_filesize and php.
The upload_max_filesize directive is a PHP variable set in the system and local php. ini files and user. ini files. These determine the PHP interpreter's baseline configuration. As you might expect, upload_max_filesize limits the maximum allowable size of an uploaded file.
This message helped me:
The newest php version installed on server does not allow global settings (such as execution time, max upload filesize, max post file size, etc.) to be changed.
Folow these steps to resolve the issue:
phpinfo();
phpinfo()
output/etc/php5/apache2/conf.d
/etc/php5/apache2/conf.d/user.ini
)File /etc/php5/apache2/conf.d/user.ini
post_max_size = 90M upload_max_filesize = 50M
Update 2018.06
If you are using nginx + php-fpm your path will be something like this (use your php version in path). Create file using:
nano /etc/php/7.0/fpm/conf.d/user.ini
There are a lot of other .ini
files in the conf.d
directory. If you want your config to be the last included - use prefix.
For example: 30-user.ini
.
After file creation don't forget to restart fpm
:
sudo service php7.0-fpm restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With