I have read many solutions on internet , but still cannot change upload_max_filesize
value (upload_max_filesize
always = 2M )
here is my loaded php.ini
in phpinfo()
:
Configuration File (php.ini) Path /etc/php/7.0/apache2
Loaded Configuration File /etc/php/7.0/apache2/php.ini
Scan this dir for additional .ini files /etc/php/7.0/apache2/conf.d
upload_max_filesize 2M 2M
post_max_size 8M 8M
here is my edited php.ini
in /etc/php/7.0/apache2/php.ini
; http://php.net/post-max-size
post_max_size = 86M
; http://php.net/upload-max-filesize
upload_max_filesize = 40M
im using ubuntu 14.04,apache2,php7.0 (I have reset apache2 many time after each change in php.ini )
I had an other fix for it. os: ubuntu 16.04 phpversion: 7.0
I created a phpinfo.php file containing:
place the phpinfo.php file in the root of your website www.mywebsite.com/phpinfo.php
Navigating to it and lookup the line:
Loaded Configuration File : /etc/php/7.0/cgi/php.ini
Now you know what php.ini file is loaded.
ssh into the server and use your favorite editing tool (mine is nano) to adjust the php.ini
change the values to meet your preferences.
post_max_size = 128M
upload_max_filesize = 64M
Save and close the file.
Restart apache
__
check the phpinfo.ini if the new values are as set.
and if they do you are set to go.
I had a fix for PHP-FPM 7.1
Edit your php.ini in
/etc/php/7.1/fpm/php.ini
Make changes to whatever option you want like, post_max_size, upload_max_filesize, max_execution_time & so...
save & close file.
run
sudo service php7.1-fpm restart
It will work!
I also found that restarting the httpd service didn't pick up changes in the loaded configuration file (
/etc/php.ini
on Fedora 29). It's worth listing all systemd units and doing a grep for the string "php":Restarting php-fpm did the trick for me:
Yeah, Actually I forgot to restart correctly.
sudo service apache2 restart is not enough
first add the configurations to /etc/php/7.1/fpm/php.ini and to /etc/php/7.1/cli/php.ini
#/php/ - then your php version here instead "7.1" ACtually one of these configuration file is the active one (if you want to see what use
<?php phpinfo() ?>
command in indextest.php file and check it on browser) Then change these parameters on each file with what you want:And then use following command to restart the php server:
or
Now you should be able to see the changes of upload size. Cheers !
as shown in here you can get to know more about the php server controlls :
Most people are forgetting to restart their php via the terminal that's why it isn't working, if you think you've done everything correctly be sure to restart your php & the server.
i fingured out !
in my loaded
php.ini
config , myerror_reporting
values isE_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
-> this is wrong!, so i changed it toerror_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 meansupload_max_filesize
always2M
)