Consejos para el desarrollo Web, estrategias de marketing y novedades de A2 Hosting enviadas a su email.
This article describes how to use custom php.ini files to control PHP settings for your web site.
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:
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:
cp path/php.ini /home/username/public_html/php.ini
To make the php.ini file accessible to the web server, but inaccessible to the public, type the following commands:
cd /home/username/public_html chmod 640 php.ini
After you copy the php.ini file and set its permissions, you can verify that the configuration is active. To do this, create a PHP test file that contains the following code in the same directory where the php.ini file is located:
<?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:
To view a complete list of php.ini directives, please visit http://www.php.net/manual/en/ini.list.php.