Changing upload_max_filesize on PHP

后端 未结 11 816
星月不相逢
星月不相逢 2020-11-22 16:50

I\'m using PHP 5.3.0 and have encountered something that might be a bug (in which case I\'ll report it) or might be me - so I\'m asking to make sure.

When running th

相关标签:
11条回答
  • 2020-11-22 17:00

    This solution can be applied only if the issue is on a WordPress installation!

    If you don't have FTP access or too lazy to edit files,

    You can use Increase Maximum Upload File Size plugin to increase the maximum upload file size.

    0 讨论(0)
  • You can't use shorthand notation to set configuration values outside of PHP.ini. I assume it's falling back to 2MB as the compiled default when confronted with a bad value.

    On the other hand, I don't think upload_max_filesize could be set using ini_set(). The "official" list states that it is PHP_INI_PERDIR .

    0 讨论(0)
  • 2020-11-22 17:01

    This can also be controlled with the apache configuration. Check the httpd.conf and/or .htaccess for something like the following:

    php_value upload_max_filesize 10M
    
    0 讨论(0)
  • 2020-11-22 17:01

    if you use ini_set on the fly then you will find here http://php.net/manual/en/ini.core.php the information that e.g. upload_max_filesize and post_max_size is not changeable on the fly (PHP_INI_PERDIR).

    Only a php.ini, .htaccess or vhost config change seems to change these variables.

    0 讨论(0)
  • 2020-11-22 17:05

    Are you using a shared hosting provider? It could be master settings overriding anything you're trying to change. Have you tried adding those into your .htaccess?

    php_value upload_max_filesize 10M
    php_value post_max_size 10M
    
    0 讨论(0)
  • 2020-11-22 17:06

    If you are running in a local server, such as wamp or xampp, make sure it's using the php.ini you think it is. These servers usually default to a php.ini that's not in your html docs folder.

    0 讨论(0)
提交回复
热议问题