Managing the PHP version for individual domains or subdomains on your hosting account is a common task to ensure compatibility and optimal performance for your websites. Here’s a step-by-step guide to set the PHP version per domain using cPanel.
Step 1: Log in to cPanel
- Open your web browser and go to your cPanel login page (e.g.,
https://yourdomain.com:2083
). - Enter your username and password, then click Log in.
Step 2: Locate the PHP Selector Tool
- In the cPanel dashboard, scroll to the Software section.
- Click on MultiPHP Manager (or Select PHP Version, depending on your hosting provider).
Step 3: Select the Domain
- In the MultiPHP Manager interface, you will see a list of all domains and subdomains associated with your hosting account.
- Locate the domain or subdomain for which you want to set the PHP version.
Step 4: Choose the PHP Version
- Check the box next to the domain or subdomain you want to update.
- In the PHP Version dropdown menu, select the desired PHP version (e.g., 8.1, 7.4, etc.).
- The version you choose should be compatible with the scripts or CMS (e.g., WordPress, Joomla) used on the domain.
- Click Apply to save the changes.
Step 5: Verify the Change
- To ensure the PHP version has been reset, create a
phpinfo.php
file in the root directory of your domain:- Go to File Manager in cPanel.
- Create a file named
phpinfo.php
in thepublic_html
folder. - Add the following code to the file:
phpinfo();
-
- Save the file and visit
https://yourdomain.com/phpinfo.php
in your browser.
- Save the file and visit
2. Delete the phpinfo.php
file after verification to prevent exposing sensitive server information.