简体   繁体   中英

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?

我不得不这样做。

service php-fpm restart

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.

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)

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

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

在我的情况下sudo service apache2 restart应用了更改。

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM