twigg
twigg

Reputation: 3983

php.ini upload_max_filesize not updating

I'm running CentOS 6.4. I've made changed to my php.ini file in the /etc folder. I have changed the upload_max_filesize from 2M to 50M so it reads:

upload_max_filesize = 50M

I've also changed the post_max_size to 52M so it reads:

post_max_size = 52M

Now I have restarted Apache using both the service httpd restart command and the /sbin/service command but when I go into my root html directory in /var/www/html and open my test phpinfo() file the values for upload_max_filesize and post_max_filesize are still the default 2M and 8M values respectively.

Have I missed something?

Upvotes: 10

Views: 23624

Answers (8)

Sam
Sam

Reputation: 31

I have set the following values in .htaccess and it's working fine. (I wanted to upload 25 MB file)

php_value post_max_size 30M
php_value upload_max_filesize 25M
php_value upload_max_size 25M

Upvotes: 0

Giovani
Giovani

Reputation: 2547

I had the same problem.

The following changes fixed the issue.

  1. Open phpinfo() and look for "Loaded Configuration File", this file should be updated.
  2. Update your php.ini file.
  3. Kill "php-fpm" process

killall php-fpm

  1. Restart httpd

systemctl restart httpd

Upvotes: 3

Dmytro Sukhovoy
Dmytro Sukhovoy

Reputation: 992

The latest php versions doesn't allow direct php.ini changes.

  1. Look for "Scan this dir for additional .ini files" directory in your phpinfo() output and create whatever-file-name.ini in this location.

  2. Put your custom variables in it.

  3. Restart the webserver.

Upvotes: 22

Leo Prince
Leo Prince

Reputation: 2050

check the loading configuration file (php.ini) from the o/p of phpinfo(). Make sure that you have made changes in the right configuration file (php.ini file)

Upvotes: 3

FosAvance
FosAvance

Reputation: 2469

I had this line uncommented, it needs to be commented Default Value: E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED in php.ini

After that I could edit any value. And of course restart your apache

Upvotes: 2

Brian
Brian

Reputation: 331

I had to do this.

service php-fpm restart

Upvotes: 33

durisvk
durisvk

Reputation: 957

In my case sudo service apache2 restart applied the changes.

Upvotes: 1

Chirag Kalani
Chirag Kalani

Reputation: 458

Check your php.ini file, don't have any errors. php.ini don't set any configuration after error line.

Upvotes: 0

Related Questions