HostMonster Web Hosting Help

PHP Configuration for Addon Domain

Summary

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.

Configure PHP for an Addon Domain

If you need to generate a new php.ini file, this can be done in the cpanel by clicking on the icon "PHP Config", choose your version of PHP and then click Save. 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.

Knowledgebase Article 111,497 views bookmark tags: domain php (updated 1140 days ago)


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

I do not want to see addon.maindomain.com. How do I do that? (updated 1132 days ago)
Knowledgebase Article 123,292 views tags: accessible addon directory domain folders hidden htaccess inaccessible primary secondary

How do I stop people from being able to use the addon domain as a subdomain of the primary domain? (updated 1141 days ago)
Knowledgebase Article 164,565 views tags: addon domain htaccess

I have setup a pointed/addon domain, where should I upload the files for this domain? (updated 1141 days ago)
Knowledgebase Article 134,786 views tags: addon domain pointed

Related Help Content

What is an Addon domain? (updated 392 days ago)
Knowledgebase Article 150,507 views tags: addon domain

PHP vs PHP single php.ini vs PHP with FastCGI (updated 1202 days ago)
Knowledgebase Article 148,963 views tags: configuration php server

How do I FTP to my addon domains without interfering with my main account. (updated 1140 days ago)
Knowledgebase Article 196,949 views tags: addon domain ftp

How do I change the PHP environment for my site with php.ini? (updated 492 days ago)
Knowledgebase Article 385,657 views tags: configuration php server

How to edit PHP Configuration --- VPS or Dedicated (updated 435 days ago)
Knowledgebase Article 8,738 views tags: dedicated php root vps whm

Can I make subdomains for my addon domains on the account? (updated 1140 days ago)
Knowledgebase Article 156,383 views tags: add addon dns domain park subdomain

What is the difference between parked domains and addon domains? (updated 1139 days ago)
Knowledgebase Article 128,302 views tags: add addon domain park parked

How do I setup an addon domain or parked domain in my hosting account? (updated 358 days ago)
Knowledgebase Article 368,166 views tags: addon domains parked