Changes to Upload_Max_Filesize in Ubuntu PHP.Ini Will Not Take Effect

php 7 php.ini upload_max_filesize not working

i fingured out !

in my loaded php.ini config , my error_reporting values is E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED-> this is wrong!, so i changed it to

error_reporting: E_ALL and then restart apache2 server,
now everything working fine !


so please note : if php.ini have any error , it will use default value (which means upload_max_filesize always 2M )

php.ini unable to change upload_max_filesize

Try to check if there is any syntax error in your php.ini, if there is any, it will not take the changes.

also make sure that your php.ini is writable

Max filesize not taking effect from php.ini

By default NGINX has a limit of 1MB on file uploads. To change this you will need to set the client_max_body_size variable. You can do this in the http block in your nginx.conf

http {
#...
client_max_body_size 100m;
client_body_timeout 120s; # Default is 60, May need to be increased for very large uploads
#...
}

If you are expecting upload very large files where upload times will exceed 60 seconds you will also need to add the client_body_timeout variable with a large value

After updating you NGINX configuration don’t forget to restart NGINX.

you need to restart nginx and php to reload the configs. This can be done using the following commands;

sudo service nginx restart
sudo service php7.0-fpm restart

Note:if you don't have to host multiple
Websites just add it to the server block

server {
client_max_body_size 8M;
}

php.ini changes, but not effective on Ubuntu

I have solved my question.

There is a syntax error in php.ini in line 109, so the next all syntax does not execute.



Related Topics



Leave a reply



Submit