Reputation: 340
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 I 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?
Upvotes: 1
Views: 19534
Reputation: 377
If you are using cPanel/WHM, use MultiPHP INI Editor to update in cPanel (Local Value) and WHM (Master Value) >> Restart Apache or other web server.
Upvotes: 0
Reputation: 31
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
.
Upvotes: 3
Reputation: 21
Make sure that you're editing the php.ini
in the conf/"server_version"
folder
Upvotes: 1
Reputation: 29
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.
Upvotes: 1
Reputation: 774
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.
Upvotes: 0
Reputation: 24873
I could solve this problem via a workaround. I created .user.ini file in the root document of my webapp and overwrite the values.
Upvotes: 0
Reputation: 19
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.
Upvotes: 0
Reputation: 5052
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.
Upvotes: 0
Reputation: 1
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.
Upvotes: -2
Reputation: 340
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!
Upvotes: 0
Reputation: 57184
If you are running PHP Fast cgi then you need to restart the process. I believe that restarting apache should do the trick.
Upvotes: 0
Reputation: 10327
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
Upvotes: 0
Reputation: 8200
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/
Upvotes: 6