Setting up a custom php.ini file
A php.ini file contains directives for controlling many PHP settings. You can set up one or multiple custom php.ini files to define how your web site functions. For example, you might have a custom file in your /home/username/public_html directory for your web site's main pages, and a separate custom file in your /home/username/public_html/images directory for your web site's image files.
To set up a custom php.ini file, follow these steps:
Log in to your VPS account using SSH.
There are several php.ini sample files that you can use as a starting point for your own custom configuration:
There is a template php.ini file located at /usr/local/lib/php.ini.
There are php.ini files for multiple PHP versions located at /opt/php/php-version/lib/php.ini, where version represents the PHP version number.
To copy one of these files to your web site's document root directory, type the following command, where path represents one of the paths listed above, and username represents your username:
Code: Select all
cp path/php.ini /home/username/public_html/php.ini
Code: Select all
cd /home/username/public_html
chmod 640 php.ini
Code: Select all
<?php phpinfo(); ?>
You can create custom php.ini files for each directory in your web site, but many people configure settings in one php.ini file and then apply it to the entire web site. To do this, add the following line to the .htaccess file in your web site's document root directory. Replace username with your A2 Hosting username:
Code: Select all
SuPHP_ConfigPath /home/username/public_html/