Changing the PHP version for your domain using cPanel is a simple process. This can help you optimize your website's performance or ensure compatibility with specific scripts. Here's how to do it.
Step 1: Log in to cPanel
- Open your browser and navigate 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 down to the Software section.
- Click on MultiPHP Manager or Select PHP Version, depending on your hosting provider.
Step 3: Choose the Domain
- In the MultiPHP Manager interface, you’ll see a list of all domains and subdomains associated with your cPanel account.
- Select the domain or subdomain for which you want to change the PHP version by checking the box next to it.
Step 4: Change the PHP Version
- In the PHP Version dropdown menu, select the version you want to use (e.g., 8.1, 7.4, etc.).
- Choose the version that is compatible with your website and scripts.
- Click Apply to save the changes.
Step 5: Verify the PHP Version
- To confirm the change, you can create a PHP info file:
- Go to File Manager and create a new file named
phpinfo.php
in your website's root directory (e.g.,public_html
). - Add the following code to the file:
- Go to File Manager and create a new file named
phpinfo();
-
- Save the file and access it in your browser (e.g.,
https://yourdomain.com/phpinfo.php
). - Check the displayed PHP version.
- Save the file and access it in your browser (e.g.,
- Delete the
phpinfo.php
file after verification to avoid exposing sensitive server information.