PHP Configuration 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.
- What is php.ini for an Addon Domain?
- How to Configure PHP for an Addon Domain in cPanel
- Related Articles
- Summary
What is php.ini for an Addon Domain?
The php.ini file is where you can find the current configuration settings for PHP, including memory limits, execution time, and more. You can also use this file to enable PECL modules. It provides the flexibility to override the server's default configuration settings.
How to Configure PHP for an Addon Domain in cPanel
If you need to generate a new php.ini file, this can be done by going to your MultiPHP Manager within cPanel. Visit the article "How To Configure the PHP Environment with PHP ini" for instructions on generating a new php.ini file. Doing so 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 use the 'single php.ini' option, you must 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-php7 .php
To verify your addon domain is using the php.ini file you have set up, 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.
Related Articles
- What Is the Difference Between Addon Domain, Parked Domain & Subdomain? - Learn more about the difference between an addon domain and a subdomain.
- How to Edit the PHP Ini Settings - Provides instructions on updating your PHP settings. You can override the PHP settings for addon domains.
Summary
The php.ini file has current configuration settings for PHP and can be used to override the server's default configuration settings. To use specific PHP settings for an addon domain, you must place a php.ini file in the addon domain's folder. To generate a new php.ini file, you can use the MultiPHP Manager in cPanel. If you use the 'single php.ini' option, you must create a .htaccess file in the addon's folder. To verify your addon domain is using the php.ini file you have set up, you can create a new file in the addon's folder called info.php containing the PHP code provided above. 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".
If you need further assistance, feel free to contact us via Chat or Phone:
- Chat Support - While on our website, you should see a CHAT bubble in the bottom right-hand corner of the page. Click anywhere on the bubble to begin a chat session.
- Phone Support -
- US: 888-401-4678
- International: +1 801-765-9400
You may also refer to our Knowledge Base articles to help answer common questions and guide you through various setup, configuration, and troubleshooting steps.