php.ini upload_max_filesize is not working

May 9, 2019 381 views
Apache PHP

Hi,

I have updated uploadmaxfilesize in php.ini (which is in the php_info()) and restarted the apache with

sudo service apache2 restart

But phpinfo() still showing uploadmaxfilesize as 2M. I even tried to restart the server but the same result. I changed the postmax_size but it is showing as 8M.

Can someone give solution to this?

1 comment
  • I have edited my php.ini file located in /etc/php/7.0/apache2/php.ini
    I have changed the “uploadmaxfilesize” value from 16mb to 32mb
    I restarted the server, and as a result, my php max upload filesize was updated.
    This was evident because i created a php info file in my /var/www/html and the changes reflected in in phpinfo.

    Did you edit the php.ini file in the right place? You have not specified any information regarding your setup. Wordpress may require changes to htaccess to increase upload size but you haven’t specified.

1 Answer

You are changing in the wrong place inside php.ini, you must search and change the following, then restart apache.

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enablepostdatareading.
; http://php.net/post-max-size
post
max_size = 512M

best, max.

Have another answer? Share your knowledge.