1. Home
  2. cPanel
  3. Incorrect PHP Version in WordPress
  1. Home
  2. WordPress
  3. Incorrect PHP Version in WordPress

Incorrect PHP Version in WordPress

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).

Important note

Any users on a CloudLinux server (such as any of our shared servers) should always use the ‘Select PHP Version’ page in cPanel to modify their PHP version

In situations like this, the solution is usually to modify your .htaccess file to remove the hard-coded incorrect PHP version.

You can do this by following the instructions below:

  1. Navigate to your cPanel account. If you’re not sure how to access your cPanel account, click here.
  2. Once logged into your cPanel account, look for the file manager icon within cPanel. File manager icon in cPanel  
  3. In the file manager, look to the top right corner of the page and select Settings. When the pop-up appears, check the box that says Show hidden files. Settings in cPanel File Manager
    Show hidden files to fix the incorrect PHP version in .htaccess
  4. While still in the File Manager, navigate to your public_html directory (or your website’s directory. Generally, this is public_html). 
  5. Once in the public_html directory, look for the file called .htaccess, right-click the file, and hit edit.

    Look in your home folder if the mentioned code is not in public_html/.htaccess.

  6. On the edit page for .htaccess, the code to comment out, to fix the incorrect PHP version, will be located towards the bottom of the page. It will look similar to the following : 
    1. # Use PHP(7|7.1|7.2|7.3|7.4) as default AddHandler application/x-httpd-php(70|71|72|73|74) .php
    2. 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. 

While this is not always the solution, it is one that often works for fixing 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 are unable to 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.

Updated on May 18, 2022

Was this article helpful?

Related Articles

Need Support?
24/7 support is available through the My Rochen portal.