Page tree
Skip to end of metadata
Go to start of metadata

This document is for a previous release of cPanel & WHM. To view our latest documentation, visit our Home page.

For cPanel & WHM 11.46

How do I change the version of PHP  on my server?

PHP 5 is the only supported major version of PHP.

You can only install one version of PHP 5 on your server, unless you install a customization such as CloudLinux's 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.

For more information, read our EasyApache documentation.

Why doesn't the homepage of a folder automatically default to index.php?

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:

# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.plx index.ppl index.cgi index.jsp index.js index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html

Apache looks for a file that matches one of these names. It starts with index.html.var, goes from left to right, and ends with home.html. If a file matches one of those names, that is the file that is used. If index.php is in the list, Apache uses the index.php file unless Apache first reaches a file that matches a name in the /usr/local/apache/conf/httpd.conf file.

If those lines are not present, add the following line to an .htaccess file:


DirectoryIndex index.php


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 in the PHP section.

How can I add or remove support for features like PHP or Java server pages to 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 access EasyApache through WHM's EasyApache (Apache Update) interface (Home >> Software >> EasyApache (Apache Update)).
  • You can also run EasyApache from the command line with the /scripts/easyapache command.

cPanel & WHM with PHP 5


WHM & cPanel no longer supports PHP 4. We strongly recommend that you update your site scripts to a version that is compatible 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 /scripts/easyapache command.

Make sure that the PHP programs and scripts that you plan to run are compatible with PHP 5.

Which version of PHP 5 will run problem-free now?

The answer to this depends upon which third-party extensions 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 in case a user ignores the warning in the interface.

Which PHP version shows in the end user's cPanel interface?

The interface shows the system default.