简体   繁体   中英

upload_max_filesize changed in php.ini file, but ini_get still shows 2M

I am no longer trying to change upload_max_filesize with ini_set. I have seen those answers.

I found what I think is the real php.ini using the path from phpinfo(). I have edited the file changing the value from 2M to 10M.

In spite of this, ini_get('upload_max_filesize') still shows 2M and my upload is still failing because the file is larger than this.

What am I missing?

There are four things to check if experiencing an issue like this:

  1. Ensure that the correct php.ini is being loaded by using phpinfo()
  2. Ensure that no extra ini files are being loaded via the --with-config-file-scan-dir option
  3. That you haven't used ini_set() anywhere in your code to override the setting
  4. That you restarted your web server after making any changes to ini files

Less commonly, you can also configure PHP to be run with the -d or --define directive which can set this setting at runtime. This would also be shown in the phpinfo() results.

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