Client Login

How do I make changes to PHP settings?

You need to use your own php.ini file in the folder where the PHP script executes. For more details click on "PHP Configuration" in your control panel.

For PHP 5, you can use one php.ini file in your public_html folder.

Note: This applies to all CleoHost shared and reseller hosting accounts.

You can download the stock version of PHP 4 and PHP 5 files in cPanel under "PHP Configuration".

Please be sure the file is named php.ini and edit it to make changes to PHP settings.

NOTE: Again, for PHP 4 you need to place php.ini in the folder where the PHP script executes. So if you place php.ini in public_html/ and your script executes at public_html/somefolder/ (or via web the address is http://www.example.com/somefolder/) then it will not load the php.ini settings. The php.ini file needs to be in public_html/somefolder/ as well.

For PHP 5, please place your php.ini in public_html and it will be used for all sub-folders.

IMPORTANT NOTE: You need to place the entire php.ini file with all settings in it. You can not place just a few settings.

php.ini precendence rules

PHP 4: local folder (higher precedence) > default global php.ini (at server level)

PHP 5: local folder (higher precedence) > public_html (or DOCUMENT_ROOT) > default global php.ini (at server level)

PHP 5 with shared SSL: local folder (higher precedence) > default global php.ini (at server level)

Examples:

1) For PHP 4, if you need to change the default settings, you need php.ini in each folder where the PHP script executes over the web.

2) For PHP 5, you can place the php.ini either in the DOCUMENT_ROOT (see note below) or in each folder where the PHP script executes.

What is DOCUMENT_ROOT?
For your main domain, it is /home/userid/public_html/ and for any subdomain/addon domain, it is /home/userid/public_html/subdomain/



Was this answer helpful?

Add to Favourites Add to Favourites

Print this Article Print this Article

Also Read