In some cases, after changing your PHP version from within cPanel, or migrating from another host, WordPress may show an incorrect PHP version (one you did not set.)
A solution is to modify your .htaccess file to remove the incorrect hard-coded PHP version.
You can do this by following the instructions below after logging in to your cPanel account. If you’re unsure how to access your cPanel account, click here.
- In cPanel, click the File Manager icon.
- In the file manager, select Settings in the top right corner of the page. When the pop-up appears, check the box that says Show hidden files.
- While still in the File Manager, navigate to your public_html directory (or your website’s directory. Generally, this is public_html).
- Once in the public_html directory, look for the file called .htaccess, right-click the file, and click edit.
- On the edit page for .htaccess, the code to comment out to fix the incorrect PHP version will be located toward the bottom. It will look similar to the following :
# Use PHP(7|7.1|7.2|7.3|7.4) as default AddHandler application/x-httpd-php(70|71|72|73|74) .php
- You can comment this out by adding # to the left of each line; you’ll want to comment it all out, then save the file.
This is not always the solution, but it often fixes an incorrect PHP version display.
The add handler overrides the PHP version you selected from within your cPanel installation and removes your WordPress site’s incorrect PHP version display issue.
If you cannot fix the incorrect PHP version in WordPress, please open a technical support ticket in your My Rochen account, and our team will be happy to assist.