Home > Help Center > Shared Hosting > Control Panel > PHP Manager in cPanel

PHP Manager in cPanel

PHP Manager is an application that greatly facilitates the management of your PHP configuration, allowing you to create custom PHP settings and activate different PHP versions for each directory/site in the hosting.

To access the application interface, you must log in to cPanel and in the Software section to click on the PHP Manager link:

php manager

PHP default version

By default, the PHP version applies to the entire hosting plan unless custom PHP versions are set in one or more directories.

To set the default PHP version from the text box in the Default PHP version section, click the arrow on the right, select the appropriate version from the drop down menu, and click the Save button:

php manager

A text message to the right of the button will confirm the successful change:

php manager

If you open the home directory (/home/cpaneluser/) through the file manager, you will find an .htaccess file (if not created) containing a single entry:

AddHandler $ {application / x-httpd-hostpulse-php70} .php .php4 .php5 .phtml

If there was an .htaccess file in the home directory, containing any valid code, when changing the default PHP version via the PHP Manager, the code defining the PHP version is added at the beginning of the .htaccess file without deleting the existing code:

AddHandler $ {application / x-httpd-hostpulse-php70} .php .php4 .php5 .phtml
# BEGIN WordPress

RewriteEngine On
RewriteBase /
RewriteRule ^ index\.php $ - [L]
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_FILENAME}! -D
RewriteRule. /index.php [L]

# END WordPress

PHP version of a directory

To make it easier to work with PHP Manager, we created two subdomains and we configured them to work from the corresponding public_html subdirectories:

phpversion5.hostpulse-demo.com /public_html/phpversion5

phpversion7.hostpulse-demo.com /public_html/phpversion7

In the PHP version per directory section you can easily select a directory to apply a specific version of PHP to it thus having different PHP versions in the same hosting plan.

You can select the domain or directory, whose PHP version can be changed, through the Select directory or Document Root fields respectively:

php manager

php manager

You must select the directory only in one field - the other is automatically set. Then select the appropriate PHP version from the Version drop-down menu. If you select the Inherit option, the directory will inherit the PHP default version for the entire hosting you specified in the Default PHP version section above:

php manager

Click the Save button to complete the configuration:

php manager

php manager

Options for PHP.INI

We want to remind you that the PHP version of a site/directory is managed through the code in an .htaccess file, put in the site directory, or in the home directory of the hosting plan or in the public_html directory.

The php.ini file manages the PHP settings for your hosting plan. You can easily customize each PHP variant in the PHP.INI options section, depending on the specific needs of your web sites.

This section consists of three parts and it is important to understand how they work to avoid the deletion of existing settings or entering incorrect ones.

In the first section, we select the domain/directory whose PHP settings we will change, just like in the PHP version change section above:

php manager

When selecting a domain/directory, two additional sections are loaded. They both will create a php.ini file in the selected directory (if one does not exist) by clicking on the Save button.

In the first case, the settings from the text boxes in the Setting column of the table are used. If you do not make any changes to any of the fields and click the Save button, a php.ini file will be created in the selected directory with the following content:

php manager

For example, we'll change three of the settings and will click the Save button again to save the changes:

php manager

In the middle section, we only work with the settings in the text boxes in the table and save the changes by clicking the Save button below.

Now let's choose the directory of the other subdomain phpversion7.hostpulse-demo.com, which also does not have a php.ini file. In the text box below the PHP settings table, let's just enter one option that does not exist in the table above:

date.timezone = Europe/Sofia

php manager

The text message confirms that the time zone setting has been successfully saved.

However, let's click the Save button below the PHP settings table:

php manager

The existing php.ini file was deleted and the contents of the options (default or custom) from the table above were added.

Important: When you click the first Save button, the information in an existing php.ini file is deleted or a new one is created only with the options (default or custom) from the table (the middle section).

If you want to create a custom php.ini file with different settings than those in the table, enter the settings in the last test box and save them by clicking the Save button at the bottom.

If you want to create a custom php.ini file with different settings than those in the table, enter the settings in the last test box and save them by clicking the Save button at the bottom.

If you want to create a php.ini file containing not only the options from the table, but also custom additional options, do the following:

1. Change the settings in the table options and click the Save button below the table to save them. 2. In the text box, enter the additional settings and save them by clicking the Save button at the bottom.

php manager

Still not finding what you're looking for?

Contact our support team with any additional questions or concerns.

Contact support