This tutorial will show you how to setup your own php.ini file, explain some of the most commonly changed configuration settings, and how to modify those settings to your needs. You will need some basic knowledge of SSH (command line) for this tutorial.
The php.ini file is what manages all configuration settings for PHP scripts that run on the server. Although our default php.ini configuration is designed to work for almost all popular web applications out of the box, we understand that the defaults are sometimes inadequate.
1. You will first need to login to your Hosting account via SSH.
2. Next, we need to copy the default php.ini file into your home directory with the following command:
cp /usr/local/lib/php.ini ~/php.ini
Note: If you are using PHP 5.3, please see the note at the end of this tutorial.
Note: you will need Bash SSH in order for the above command to work.
3. We now need to tell the web server where it should look for our custom php.ini file. This can easily be setup with the following command (you don’t need to edit this command at all, just run it):
echo "SuPHP_ConfigPath $HOME" >> ~/public_html/.htaccess
If you already have a .htaccess file in your public_html directory, make sure that the command placed the SuPHP details on a NEW line inside the file. You may also want to move it to the top of the htaccess file.
4. You can then edit your php.ini file and make the necessary customizations. Any changes you make to your php.ini file will occur immediately and never require a web server restart.
Note: If you are using PHP 5.3 (Generally you will have AddHandler application/x-httpd-php53 .php within your .htaccess file.) then you will need to copy the php.ini file for PHP 5.3. This will ensure that modules continue to work, and your site does not stop working after this process.cp /usr/local/php53/lib/php.ini ~/php.ini