开发者

upload_max_filesize set to 4M in phpinfo(), can't change it!

I've got this in my php.ini

upload_max_filesize = 25M
post_max_size = 25M

and I've got this in my .htaccess

php_value upload_max_filesize 26214400
php_value post_max_size 26214400

as shorthand can only be used in the php.ini (http://www.php.net/manual/en/faq.using.php#faq.using.shorthandbytes)

but no matter what I do, when i call phpinfo() I get

Directive               Local Value     Master Value
upload_max_filesize     4M              25M

I've looked at all other php.ini files, my .htaccess, ini_set(). Anything 开发者_如何学CI could think of and nothing will change it from 4M. Any help would be great!

EDIT: restarting apache didn't work, i've check my httpd.conf, it seems like an external file or something. any other places to check?


That doesn't look like proper syntax for a php.ini file.

upload_max_filesize = 25M
post_max_size = 25M

Then, make sure to restart Apache.

If you still have troubles, refer to: http://www.cyberciti.biz/faq/linux-unix-apache-increase-php-upload-limit/


I had same issue, but restarting php-fpm helped. So it didn't help to restart just apache2, but this command:

sudo systemctl restart php7.3-fpm

Cleared probably some cache and took the new modified php.ini.


If you're using OSX then make sure your php.ini file is not the default one in /etc (php.ini.default) with the command php --ini, output sample :

Configuration File (php.ini) Path: /etc
Loaded Configuration File:         /etc/php.ini
Scan for additional .ini files in: /Library/Server/Web/Config/php
Additional .ini files parsed:      (none)

in case the first line: Configuration File (php.ini) Path with empty parameter make a copy of the default php ini and the changes will take affect.


also, you'll have to check the memory_limit directive.

If it's lower than upload_max_filesize or post_max_size then their value will be limited to the memory_limit value.

Anyway, post_max_size should be slightly larger than upload_max_filesize (any posted values other than the file itself would need some memory as well)

On modern systems, memory_limit should be at least 64M, 128M or more is recommended


If you are running PHP Fast cgi then you need to restart the process. I believe that restarting apache should do the trick.


Problem was it was actually being set in another .ini file that didn't appear at first glance to be related to anything!

Note to self: always use "grep" to search within files when things are fishy!


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.


If you are using WAMP then make changes in proper php.ini which apache uses, normally its found in C:\wamp\bin\apache\\bin.

make changes in 2 parameters post_max_size and upload_max_filesize (found in line 734 and 886, usually), to 50M (to upload files upto 50 MB).

don't forget to restart apache.


I could solve this problem via a workaround. I created .user.ini file in the root document of my webapp and overwrite the values.


I was facing the same issue. Check Loaded Configuration File path in php info. Then open that file and change the variables you want and restart your apache server.


Make sure that you're editing the php.ini in the conf/"server_version" folder


Make sure that your computer is not hiding a .txt on the end of the php.ini file.

Use terminal or right click / get info or properties.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜