For cPanel & WHM version 11.50
How do I change the version of PHP on my server?
PHP 5 is the only major version of PHP that cPanel & WHM supports.
You can only install one version of PHP 5 on your server, unless you install a customization (for example, the CloudLinux™ PHP selector).
You can install a different minor version of PHP on your server in WHM's EasyApache (Apache Update) interface (Home >> Software >> EasyApache (Apache Update)). After Apache fully compiles, you can access the new PHP installation.
How can I ensure that the homepage of a folder automatically defaults to the
Some lines in the
/usr/local/apache/conf/httpd.conf file allow the
index.php file to display automatically. If the following lines are present, the
index.php file displays:
Apache searches for a file that matches one of these names. The search starts with the
index.html.var file, searches from left to right, and ends with the
home.html file. If a file matches one of those names, the system uses that file. If the
index.php file is in the list, Apache uses the the
index.php file, unless Apache first reaches a file that matches a name in the
If those lines are not present, add the following line to an
For more information about
.htaccess files, read the Apache documentation.
Which PHP modules and plugins does cPanel & WHM support?
You can find a list of supported modules and plugins in our EasyApache documentation.
How can I add or remove support for features like PHP or Java server pages on my Apache webserver?
You can add or remove support for features from the Apache webserver with WHM's EasyApache (Apache Update) interface (Home >> Software >> EasyApache (Apache Update)).
You can also run EasyApache from the command line with the
cPanel & WHM with PHP 5
How do I upgrade from PHP 4 to PHP 5, and what changes do I need to make?
To upgrade from PHP 4 to PHP 5, recompile PHP during the Apache build process. You can start the Apache build process in WHM's EasyApache (Apache Update) interface (Home >> Software >> EasyApache (Apache Update)), or from the command line with the
Make certain that the PHP programs and scripts that you plan to run are compatible with PHP 5.
Which version of PHP 5 runs without problems?
The answer to this question depends on the third-party extensions that you need. For example, the
suhosin patch is not compatible with concurrent PHP.
EasyApache resolves some dependency issues before the build. This process skips extensions that are incompatible, to lessen the problems if a user ignores the warning in the interface.
Which PHP version shows in the end user's cPanel interface?
The cPanel interface displays information for the system's default version of PHP.
How can cPanel users choose to use a specific version of PHP?
cPanel users must rename scripts to choose a specific version of PHP. For example, if the administrator specifies PHP 5 as the default, and the cPanel user's scripts need PHP 4, the PHP 4 handler executes scripts that are renamed with the
.php4 file extension.
cPanel users can override these settings via
We do not recommend that the end user use
.htaccess files to override.
The administrator can use VirtualHost Includes to specify overrides. To do this, include a configuration file in the vhost.
The following example includes a configuration file in the vhost:
Place the configuration file in either of the following directories:
- In the above examples,
/user/represents your username.
- You may need to create these directories. After you create them, execute the
/scripts/ensure_vhost_includesscript. Add the
--helpflag to explain the use of the script.
AddhandlerMIME types that you use for overrides depend upon the specific PHP setup and handler configuration.