How to change PHP version on Business servers

ByJUJU-dev

How to change PHP version on Business servers

How to change PHP version on Business servers

This guide will show you how yo manage PHP settings on our Business servers (Stellar Business and old Business SSD plans).

Our Business servers are running with FCGI module and have PHP 5.2 – 5.6 and 7.0 – 7.3 versions available. To change the PHP version for your account or a separate addon domain, follow these steps:

 

How to manage PHP settings using the PHP Tweaks plugin

 

 

For cPanel Basic Theme:

 

1. Log into your cPanel.

2. Go to the Exclusive for Namecheap Customers section >> the PHP Tweaks menu:

3. You can select the domain from the corresponding drop-down menu and manage the following group of settings:

The PHP version section allows you to check the version which is currently used and set the required one.

NOTE: The list of the available modules varies depending on the PHP version you select.

The Loaders and Caches sections allow you to choose the PHP loader for your scripts and the PHP accelerator for caching the compiled bytecode of your PHP scripts.

The Others section provides you with the list of additional modules and extensions which can be enabled according to your needs:

NOTE: There are the following modules conflicts:
  • nd_mysql conflicts with mysql;
  • nd_mysqli conflicts with mysqli;
  • nd_pdo_mysql conflicts with pdo_mysql;
  • gmagick conflicts with imagick.

4. Should you need to reset PHP configuration you currently have, select the domain name and hit Reset Extensions. That will revert all the changes and roll your PHP settings for the domain in question back to the default state:

 

For cPanel Retro Theme:

 

1. Log into your cPanel.
2. Go to the Exclusive for Namecheap Customers section >> the PHP Tweaks menu:

3. You can select the domain from the corresponding drop-down menu and manage the following group of settings:

The PHP version section allows you to check the version which is currently used and set the required one.

NOTE: The list of the available modules varies depending on the PHP version you select.

The Loaders and Caches sections allow you to choose the PHP loader for your scripts and PHP accelerator for caching the compiled bytecode of your PHP scripts.

The Others section provides you with the list of additional modules and extensions which can be enabled according to your needs:

NOTE: There are the following modules conflicts:

  • nd_mysql conflicts with mysql;
  • nd_mysqli conflicts with mysqli;
  • nd_pdo_mysql conflicts with pdo_mysql;
  • gmagick conflicts with imagick.

4. Should you need to reset PHP configuration you currently have, select the domain name and hit Reset Extensions. That will revert all the changes and roll your PHP settings for the domain in question back to the default state:

How to increase memory_limit

Note that memory_limit cannot be increased via the PHP Tweaks menu. In order to change its value, follow the steps below:

1. Log into your cPanel account and navigate to the Files section >> the File manager menu:
For cPanel Basic Theme:

For cPanel Retro Theme:

Navigate to the /home/cPanel_user directory:

Make sure that you enabled the Show Hidden Files (dotfiles) option in the Settings menu:

2. Navigate to the following directory /home/cPanel_user/.system-php/conf:

3. There you will see the list of the domains hosted in your cPanel account. Move further and enter the folder of the domain you need to increase memory_limit for. By default, there is a single file called php_ver:

This file defines the PHP version set for the domain:

NOTE: If you change the value specified in the php_ver file, your current PHP version will be changed accordingly, the changes will be reflected in the PHP Tweaks menu as well.

4. Now you need to create a new file called memory_limit:

5. Once done, right-click on the file >> the Edit option:

6. Simply specify the desired value (for example, 128M) and hit Save:

How to work with a php.ini file

Apart from the PHP Tweaks plugin, you may need to alter some of the settings using a php.ini file. One of the most common requests is to increase post_max_size and upload_max_filesize limits which can be done with the help of a php.ini file. Before proceeding, download php.ini for the required PHP version here.

1. Log into your cPanel account and navigate to the Files section >> File manager menu:
For cPanel Basic Theme:

For cPanel Retro Theme:

Make sure that you enabled the Show Hidden Files (dotfiles) option in the Settings menu:

2. Navigate to the following directory /home/cPanel_user/.system-php/ini:

3. Here you need to select the PHP version you have set for your domain and the domain name itself. Thus, the full destination path will look like /home/cPanel_user/.system-php/ini/5.6/nctests.info:

4. Now you need to upload the php.ini file that corresponds to your current PHP version. Once done, use the Extract option:

4. After that, right-click on php.ini.txt to Rename it php.ini. Then, another right click to proceed with the Edit option:

5. Here you can use Ctrl+F key match for your convenience – it will allow you to find the needed limit or value. In our case, it is upload_max_filesize:

6. Once all the required changes are performed, hit Save.

That’s it!

About the author

JUJU-dev administrator

Leave a Reply

six − three =