Support » Fixing WordPress » WordPress .php version

  • A few days ago, I used the “MultiPHP-Manager in my Hosting provider’s Cpanel, to set the PHP version used on my site, to be 7.3.
    Immeadiately afterward, I found I could log into my site’s dashboard – instead, I got the following error message:

    “Warning: Use of undefined constant WP_CONTENT_DIR – assumed ‘WP_CONTENT_DIR’ (this will throw an Error in a future version of PHP) in /home3/canjuaa2/public_html/wp-includes/load.php on line 115
    Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”

    I then contacted Hostgator support, who was able to resolve my login difficulties fairly quickly. On asking what had been the problem, the support agent told me it was a misconfiguration in my .htaccess file, which was now sorted.

    However, while MultiPHP-Manager reported Ver 73 (or 7.3) PHP now installed, I continued to receive a warning on My Site’s dashboard, which says:
    ! PHP Update required
    WordPress has detected that your site is running on an insecure version of PHP.

    ON checking under “Woocommerce > Status”, I find that Woocommerce reports my site is still using PHP Version 7.1.14 as follows;

    Server environment:
    PHP version: 7.1.14 – We recommend using PHP version 7.2 or above for greater performance and security. How to update your PHP version

    Another call to Hostgator support was rather unsuccessful in resolving this issue. All I was told to do was to use the MultiPHP-Manager in Cpanel to set my PHP version to be version 74(7.4). This I did, but while MultiPHP-Manager now says I am using Version 74 (7.4), Woocommerce Status still reports Version 7.1.14 being used, as above.

    My site has the latest version of WordPress (5.5 – re-installed several times) the latest Woocommerce (4.4.1), and all other plugins also have their latest versions installed also – except for an update to Elementor and Contact Form 7, both of which only became available today.
    There has also just become available a theme update (for OceanWP), but it is accompanied by the message:

    “You have version 1.8.6 installed. Update to 1.8.7.
    This update doesn’t work with your version of PHP”

    Therefore I have not attempted to install this update, until I can get my PHP sorted.
    I also deactivated all my plugins, but nevertheless still got the message shown above – i.e.
    ! PHP Update required
    WordPress has detected that your site is running on an insecure version of PHP.

    I have no idea what I can do to resolve the issue – can anybody please advise??
    Regards – Julia C.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Check your site’s .htacccess file. That can be used to specify a PHP version and might be holding you at the older one. Also look for a php.ini file.

    Thread Starter fingers.morris

    (@fingersmorris)

    Hi Steve – Thanks very much for replying to my query – it is very much appreciated. I apologise for the delay in getting back to you – I got bogged down with work I needed to get out (but not complaining!!).

    Regarding my .htaccess file, there is a reference to the PHP version as the final entry in it, and it now reads as follows:

    # php -- BEGIN cPanel-generated handler, do not edit
    # Set the “ea-php74” package as the default “PHP” programming language.
    <IfModule mime_module>
      AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
    </IfModule>
    # php -- END cPanel-generated handler, do not edit

    I have tried deleting these few lines of code from the .htaccess file, but have not noted any difference to the error/warning messages I have mentioned – with or without these lines of code installed.
    Regarding a PHP.ini file, there certainly is one, containing over 1700 lines of code – but none that I found referring to the version of PHP installed.

    What confuses me somewhat, is the fact that I have upgraded to the latest version of WordPress (5.5), then reloaded it again several times from the Dashboard > Updates menu, I was thinking that this may have allowed WordPress to recognise that PHP version 74 (7.4) is now installed (according to Cpanel).

    I do not think this problem is related to my theme, as I have changed the theme to be Twenty Twenty, (as well as Twenty Seventeen), yet still get the same error messages.
    However, while changing themes, I found a further error message on the Theme page (Appearance > Themes), which says that Woocommerce Stylesheet is missing.
    However, in the Woocommerce > Assets > CSS directory, Cpanel shows both “woocommerce.css”, and “woocommerce.scss” present.
    So, I am now even more confused!!

    Where are the files are located, that actually decide which version of PHP is installed – do we know??
    Thanks
    Julia C

    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    One problem per topic, please. Let’s continue with the PHP version issue only.

    Please contact your host to look int othis. They have access to everything and they can diagnose it.

    Thread Starter fingers.morris

    (@fingersmorris)

    Thanks again for your response.

    You say “One problem per topic, please” – from my end, I didnt realise I had started another topic , as I thought all the problems to be interconnected.

    I am going to follow your advice, and contact my host again – for the 3rd time, ,to see if there is something they can do further.

    Thanks again
    Julia C

    Thread Starter fingers.morris

    (@fingersmorris)

    Having spent a further 85 minutes chat time with Hostgator, the support Rep assures me that I am on ver 74(7.4) of PHP – yet cannot explain why I still have reports from WordPress, Woocommerce, and I additionally now see BackupBuddyas well) saying I have earlier versions installed.
    My 3 year subscription to Hostgator is due to expire in a few weeks, so if I have any problems due to PHP being out of date, I shall change to another Host and set up a new managed WordPress site – and import a backup of my site, into what should be an error-free new installation.
    Regards
    Julia C

    • This reply was modified 1 year ago by fingers.morris. Reason: typing error, due to AZERTY Keyboard
    • This reply was modified 1 year ago by fingers.morris.
    Moderator Steve Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Look for php related stuff in *other* .htaccess and php.ini files.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘WordPress .php version’ is closed to new replies.