Support Center » Knowledgebase » Unix Tips » Custom php.ini for Unix

Custom php.ini for Unix

On Unix, it is possible to use your own php.ini. Possible reasons for using your own php.ini:
  • If you need to use a certain php extension that isn't normally loaded by our default configuration
  • If you need to change php options that aren't normally changeable via the .htaccess or .user.ini mechanism


There are some disadvantages when using your own php.ini: 
  • You lose the ability to select the php version via the control panel
  • Any changes we made on the global php.ini will not be reflected on your site
  • Changes you made to php.ini will not be applied instantly


1. Create a directory
2. Create a php script wrapper:
exec /hsphere/shared/php53/bin/php -c /hsphere/local/home/youracct/ "$@"
Replace php53 with the corresponding version that you wish to use. For example, for php 5.5, use "php55".

If you just want to load a custom php extension, there's no need to go with the whole shebang of having your own php.ini. You can still use the global php.ini and only instruct php to additionally load your extension like this:
exec /hsphere/shared/php53/bin/php -d "$@"

3. Set the execute bit for this file chmod 755

4. Create
Options +ExecCGI
SetHandler fcgid-script
5. Create / edit
RemoveHandler .php
AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /php/php-wrapper

Article Details
Article ID: 230
Created On: 21 Mar 2016 02:58 PM
 Login [Lost Password] 
Remember Me:
Please note that the login and password to the support area is NOT the same as your hosting control panel login and password
 Article Options
Home | Register | Submit a Ticket | Knowledgebase | Downloads | Control Panel User's Guide | Server Status