I'm trying to change the PHP file upload from 2MB. I've changed the php.ini files found in /etc/php5/apache2 and in /etc/php5/cli to other values, but my phpinfo() page shows me that the upload_max_filesize is still stuck on 2MB!
I've checked upload_max_filesize and post_max_size in both the php.ini files with no luck. I've restarted the Apache server multiple times and haven't seen any changes. I'm running Ubuntu 12.04 and I'm completely stumped!
Related
I have changed every last PHP.ini, *.ini related or unrelated on my server for setting post_max_size to 8000M but its not working.But atleast 50M will do my work.I am stuck here.
restarted server after changing every php.ini
httpd - k restart
even stopped server and start again.
but i cant see a small change in PHP.info
tried various tricks like
1) php_ini
2) .htaccess
3) .user.ini
but not getting desired result .Please help
I have dedicated server.With WHM and root access but still nothing working
CentOS release 6.8 (Final)
All the suggested answers make change in HTACESS or php.ini while i already changed on it. more than any time.
First create a phpinfo.php file within your web directory (ideally in the same folder where the scripts you are testing are saved) containing:
<?php
phpinfo();
Then access this file using a browser.
Right close to the top there is a line saying:
Loaded Configuration File /etc/php/some/path/php.ini
Edit the loaded php.ini file as follows:
; Maximum allowed size for uploaded files.
upload_max_filesize = 50M
; Must be greater than or equal to upload_max_filesize
post_max_size = 50M
Your question mentions only post_max_size, but if your form accepts files you need to change upload_max_filesize too.
After that you need to restart the web sever (apache?). If you are using php-fpm then you need to restart that process. I don't know about centOS, but for ubuntu commands can be:
sudo service apache2 restart
sudo service php-fpm restart
Reload the phpinfo file in your browser and check if both values have been updated.
I set both upload_max_filesize and post_max_size to 128M in my php.ini file, restarted MAMP but it did not work. In my phpinfo() it says that upload_max_filesize is set to 32M and so is post_max_size. Why would this be happening? I made sure that I'm editing the correct php.ini and restarting everything accordingly. Any help would be great. Thanks
If you're using MAMP Pro, you need to edit your php.ini file in the MAMP menu under File > Edit Template > PHP > PHP x.xx php.ini
The problem is that MAMP Pro dynamically generates the php.ini on every start and therefore overwrites your manually edited file.
After updating to Yosemite there were a lot of changes including php and mysql versions.
I copied php.ini.default to php.ini.
Although I changed max_upload_size value (to 50M) in /etc/php.ini file, the max upload size in phpMyAdmin has not been changed.
Yes, I did not forget to restart apache.
phpinfo() from /Library/WebServer/Documents shows php.ini path as /usr/local/php5/lib.
Hence editing php.ini with max_upload_size to increased value did the job.
Thanks!!
I am using XAMPP on Mac and I am trying to locate my php.ini file and I ran the phpinfo() function and found the path to php.ini file and when I open it the post_max_size and upload_max_filesize have different values then phpinfo, I changed the values and restarted my server and the changes did not take effect. How do I find out where the php.ini file is?
in my phpinfo(); I see that my php.ini file is in /etc/php5/cgi, I've changed there upload_max_filesize to upload_max_filesize = 2000M, but in my phpinfo(); I see that the value stays 2M, and when I upload a file it tells my that I exceed the maximum upload_max_filesize limit, why is that? I've restarted apache but nothing changed, any clues?
ps: using php as fastcgi
/etc/php/cgi/php.ini configures only php running in cgi mode (like in lighttpd). you need to make changes on /etc/php/apache2/php.ini
For Fedora 20, you can find your environment php.ini files in
/usr/share/doc/php-common/php.ini-development
/usr/share/doc/php-common/php.ini-production
or just do
locate php.ini
Go on ahead and apply the above changes there.
You don't need to restart the server. Just do
sudo service httpd reload