Issue
I am currently trying to locate the correct php.ini file to edit it and restart Apache, so the changes will take place and I'm stumped.
What I have done...
I have found three different php.ini files (I don’t have any idea why there are three). This is how I found the files: sudo find / -name php.ini
. It resulted in the following....
/etc/php5/cli/php.ini
/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini
I also did....
sudo php -i | grep 'Configuration File'
This showed....
Configuration File (php.ini) Path => /etc/php5/cli
Loaded Configuration File => /etc/php5/cli/php.ini
I changed all of them (just to be sure) to the settings I wanted.
I restarted Apache using:
sudo service apache2 restart
The results...
* Restarting web server apache2
I reloaded the page and it showed that the php.ini file was not updated.
I know this because I used
echo ini_get('post_max_size');
Which was supposed to be changed to 20M, but it was still only 2M.
I tried rebooting my computer thinking maybe that would legit stop the Apache server and reload the php.ini file with the correct setting, but alas that attempt also failed.
Is there any chance there could be another php.ini file that could be interfering?
A better, more helpful for other users answer can be found here: Find the correct php.ini file
Solution
The answer to this was very simple. Somewhere in my php.ini file I had a syntax error (or an error of some kind).
To fix this, I downloaded the latest php.ini file from http://git.php.net/?p=php-src.git;a=blob_plain;f=php.ini-production;hb=HEAD and then changed the values for upload_max_filesize and post_max_size, restarted Apache, reloaded my php_info() and everything was working as expected!
Answered By - Michael