Support » Fixing WordPress » Wrong PHP version in Site Health

  • hiker

    (@hikeventures)


    I have installed the latest PHP version on my server and also checked in SSH Terminal the version. When I check the version in WP Site Health it still shows my old version. I have also restarted the server and it didn’t help. I use the latest WP version

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Site health is telling you what WordPress sees. Most servers can support multiple versions of PHP. Check both the .htaccess file for your site and an php.ini files to see if they’re picking a version other than the one you just installed.

    hiker

    (@hikeventures)

    Thanks Steve, my .htaccess file is blank and I have also changed my php.ini. Still doesn’t work …

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    You can’t have a working WP site and a blank .htaccess file! Anyhow, there’s something in your configuration that’s overriding the change you made to PHP and that occurs outside of WordPress. Tell me about your hosting.

    hiker

    (@hikeventures)

    I am hosting my site on Hetzner.
    When I look in FTP then I see a .htaccess file with 0kb and it’s empty. It is located in this directory: /home/hikeventures/hikeventures

    I also have nginx and there I have changed the line below with the PHP version installed:
    fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

    directory: /etc/nginx/sites-available

    In the php.ini which is located here /etc/php/7.4/fpm I have changed different max values.

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    What do you see if you try

    ps -ef |grep php ?

    What version of php is running?

    hiker

    (@hikeventures)

    root      1131     1  0 Mar17 ?        00:00:13 php-fpm: master process (/etc/ph                               p/7.2/fpm/php-fpm.conf)
    www-data  1413  1131  0 14:17 ?        00:00:12 php-fpm: pool www
    www-data  1536  1131  0 14:23 ?        00:00:27 php-fpm: pool www
    www-data  1649  1131  0 14:27 ?        00:00:06 php-fpm: pool www
    hikeven+  3006  2980  0 15:17 pts/0    00:00:00 grep --color=auto php
    root      9234     1  0 Mar17 ?        00:00:10 php-fpm: master process (/etc/ph                               p/7.4/fpm/php-fpm.conf)
    www-data  9259  9234  0 Mar17 ?        00:00:00 php-fpm: pool www
    www-data  9260  9234  0 Mar17 ?        00:00:00 php-fpm: pool www
    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    So you have two php-fpm processes running. What happens if you stop the one from 7.2?

    sudo kill -9 1131

    This is clearly not a WP problem but a Linux admin issue.

    hiker

    (@hikeventures)

    Now I get an error Error 502 when I visit my site …

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    OK, so something in your nginx or httpd config is referencing PHP 7.2. You’re going to have to dig through your configs in /etc (and other places) as well as in the site’s root to find out what’s doing it.

    Restart that php-fpm process to get your site working again.

    hiker

    (@hikeventures)

    Thanks, Steve, is there maybe a program which could trace from where this PHP 7.2 referencing comes? There are quite a lot of files …

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    Linux sysadmin is not for the faint of heart! I’d ask in a support forum for your particular Linux flavor.

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Wrong PHP version in Site Health’ is closed to new replies.