Wordpress php version different than server

Viewing 11 replies - 1 through 11 (of 11 total)

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

    Thread Starter hiker

    (@hikeventures)

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

    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.

    Thread Starter 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.

    What do you see if you try

    ps -ef |grep php ?

    What version of php is running?

    Thread Starter 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
    • This reply was modified 2 years, 6 months ago by Steven Stern (sterndata).

    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.

    Thread Starter hiker

    (@hikeventures)

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

    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.

    Thread Starter 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 …

    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)

    I have a WP website that run on ubuntu 14.4 with php 7.0.21. but when i check the WP PHP version i get Running PHP version: 5.5.9-1ubuntu4.22 on the server php -v comment return :

    PHP 7.0.21-1~ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jul 6 2017 09:38:10) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with Zend OPcache v7.0.21-1~ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies Why do I have this conflict? Do I need to make any upgrade in WP?

    asked Nov 11, 2018 at 7:27

    Wordpress php version different than server

    2

    It turns out that the version that was defined on Apache was different from that configured on the server. I Fixed that by change the defulte php version on the apache

    sudo a2dismod php5
    sudo a2enmod php7.0
    sudo services apache2 restart 
    

    answered Nov 12, 2018 at 15:11

    Wordpress php version different than server

    How do I update the PHP version on my WordPress server?

    To update your WordPress site's PHP version, go to Sites and select the site you'd like to change the PHP version on. Then click on the Tools tab. Under PHP Engine click on the Modify button and select your preferred PHP version in the drop-down menu.

    What version of PHP should WordPress use?

    PHP version 7.4 is highly recommended by the official WordPress team. This version was released in Nov 2019 and over 28.7% of WordPress websites are running on it.

    Can we change PHP version in managed WordPress?

    In your My Products page, next to Managed WordPress, select Manage All. menu. Under Production Site, next to PHP version select Change. From the menu, choose the PHP version to change to, then select Save Changes.

    How do I update PHP to 7.4 in WordPress?

    Navigate to the Manage Domains page. Click the Edit link to the right of a domain. On the domain's settings page, look under the Web Options section for the PHP version: You should upgrade to 7.4 or 8.0.