If you ever encounter problems with the way your server handles PHP packages, it may be helpful to view and/or modify your server's PHP configuration. HostGator has included a plugin called PHP Selector in cPanel to make setting up your PHP environment easy.
Update PHP Version for a Site
PHP Selector allows users on Shared and Reseller servers to easily enable a specific PHP version for a site without having to manually add a handler to the .htaccess file. To update the PHP version for a site:
- Log into cPanel.
- In the Software section, click on the PHP Configuration icon.
- Navigate to the directory for which you'd like to update the PHP version (or stay in your home directory if you want to select for your entire cPanel).
- From the drop-down menu, select a specific version of PHP or the System Default:
- No custom PHP Handler (Sys Default) - This option will use the server default and remove any existing configuration.
- PHP Cur - This option will automatically use the latest stable version of PHP on the server.
Caution: If your site's scripts rely on older functions of PHP which are no longer available in the latest stable version being used on the server, you may encounter compatibility issues when PHP Cur is automatically updated.
- Click the module_update button.
When using PHP Selector, updates are applied recursively. This means any update you apply to a directory will also apply to all sub-directories, unless you apply a different directive to one of those sub-directories. Therefore, to use a different PHP version for an addon domain, you would need to navigate to the document root for the addon domain and select the appropriate version of PHP.