https://help.superhosting.bg/en/set-php-version-for-directory.html
  • bg
  • en

Hosting, Domains, Cloud, Virtual Private Servers (VPS), Managed VPS, SSL Certificates

How to Change PHP Version for a Specific Directory?

Control Panel cPanel
php, php version, php 5.2, php 5.3, php 5.4, php 5.5, php 5.6, php 7, php 7.1, php71

Under PHP Manager in cPanel you can change the PHP version for the entire hosting account or for a specific directory.

Below you can read how to set a different PHP version for a specific directory (website) of your hosting account.

Choosing a PHP Version (FastCGI) for a Specific Directory

You can enable a different PHP version for a certain directory (website) in two easy steps.

You first need to access "Set the PHP version for a particular directory" section under PHP Manager in cPanel.

Choosing PHP version and directory

From the options there you have to select the PHP version (1) and enter the desired directory (2). Finish the setup by clicking the Add button (3).

You need to create an .htaccess file or edit the existing one, located in the same directory. Afterwards, you should add the following lines to the file:

<IfModule mod_fcgid.c>
AddHandler fcgid-script .php
FcgidWrapper /home/cpuser/dir/php.fcgi .php
</IfModule>
/home/cpuser/dir/ - replace it with the path to the directory;

You can copy these lines directly from the PHP manager after adding the system files to the desired directory.

After saving the changes in the .htaccess file, the selected PHP version will be enabled for the specified directory. You can check the PHP version that is enabled for the directory by placing a PHP file with phpinfo().

info-iconImportant: If there is an already existing .htaccess file that contains a line for PHP version setup such as AddHandler x-httpd-phpXX .php, you will have to remove it.


info-iconIn case you are not sure which version is enabled for the server where your hosting account is located, do not hesitate to сontact SuperHosting.BG technical support team.

500px270px
SuperHosting.BG
    Control Panel cPanel
  • PHP Manager by SuperHosting
    In cPanel you can change the PHP settings for all hosting plans offered by SuperHosting.BG. You can change the PHP version, enable or disable PHP modules and change PHP directives. This... »
  • How to login to cPanel?
    You could find detailed description on how to login to cPanel in the email which you have received after your hosting account was created. One way is to write your... »
  • SuperTools Available in cPanel
    cPanel offers a few special Super tools developed by SuperHosting.BG that enable you to manage more easily and quickly the content of all websites, hosted on your account. SUPERHOSTING TOOLS In the... »
  • Redis Manager by SuperHosting
    Redis is supported for the SuperPro and SuperHosting plans. To use Redis, you need to activate it in cPanel. Login to cPanel and select the "Redis Manager by SuperHosting" menu. Choose the amount of... »
  • Most Used Ports
    This is a list of the most commonly used ports, which you can use to access the specified services. In the tables are described the services (or protocols), connection type... »
All rights reserved © 2005-2017 , www.superhosting.bg