You can review the live PHP configuration by placing a page with a phpinfo
function along with your website files.
To create a file with this command, first change into the directory that contains your website files. For example, the default directory for webpage files for Apache on Ubuntu 14.04 is /var/www/html/
:
1 |
cd /var/www/html |
Then, create the info.php
file:
1 |
sudo nano /var/www/html/info.php |
Paste the following lines into this file and save it:
1 2 3 |
<?php phpinfo(); ?> |
When visiting the info.php
file on your web server (http://www.example.com/info.php) you will see a page that displays details on the PHP environment, OS version, paths, and values of configuration settings. The file to the right of the Loaded Configuration File line shows the proper file to edit in order to update your PHP settings.
This page can be used to reveal the current settings your web server is using. For example, using the Findfunction of your web browser, you can search for the settings named post_max_size and upload_max_filesize to see the current settings that restrict file upload sizes.
1 |
sudo nano /etc/php5/apache2/php.ini |
In this we need to change values of
1 2 3 4 5 6 |
memory_limit 256M post_max_size 256M upload_max_filesize 64M max_input_vars 1800 max_execution_time 300 max_input_time 300 |
restart server
1 |
sudo service apache2 restart |
Refreshing the info.php
page should now show your updated settings. Remember to remove the info.php
when you are done changing your PHP configuration.