PHP Configuration for Addon Domain

How can I adjust the php settings specifically for an Addon Domain?
To use specific php settings only for a particular addon domain you will need to place a php.ini file in the addon domain's folder.

If you need to generate a new php.ini file, this can be done in the cpanel by clicking on the icon "PHP Config" and then clicking "install php.ini master file". This will copy the server's master php.ini to your public_html directory as "php.ini.default". This file must then be moved to the addon's folder and renamed to php.ini.

If you are using the 'single php.ini' option in the cpanel's "PHP Config" section, you will need to create a .htaccess file in the addon's folder. In the addon's .htaccess file it needs to contain a regular php handler:

 

AddHandler application/x-httpd-php5 .php

To verify your addon domain is using the php.ini file you have setup, you can create a new file in the addon's folder called info.php containing the following php code:

 

<?php
phpinfo();
?>

Viewing the info.php file in a web browser should show you all the php settings from the addon's php.ini including the "Loaded Configuration File". This is the path to the php.ini file being used.

  • 49 Users Found This Useful
Was this answer helpful?

Related Articles

Configuring the PHP Environment With php.ini

Problem: How do I change the PHP environment for my site with php.ini? Solution:   To...

PHP with FastCGI

Problem: What is FastCGI for PHP? Solution: FastCGI for PHP makes all your PHP applications...

Upload_Max_Filesize

Problem: How do I change my upload_max_filesize? Solution: Summary Locate the php.ini...

Cron Jobs with PHP Files

How do I run a php file using Cron jobs?   From the cPanel, click the Cron Jobs icon and enter...

Basic Site Security Checklist

Remove malicious files and/or files you are not familiar with. While many PHP applications...