• Hello

    I have updated my root server from Debian 8 to Debian 10.
    After that I updated the outdated PHP version to 7.4.14.
    Everything seems to work so far again only in the WordPress website health I still see PHP version 5.6.

    The output of phpinfo(); shows the following

    PHP Version 5.6.40-0+deb8u12
    Configuration File: /etc/php5/apache2
    Loaded Configuration File: /etc/php5/apache2/php.ini

    So it seems that wordpress / Apache2 still use PHP Version 5.6…

    The output of php -v shows

    PHP 7.4.14 (cli) (built: Jan 12 2021 13:59:46) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.14, Copyright (c), by Zend Technologies

    I already have spent many hours searching but unfortunately have not found a solution that adress my problem. Can someone kindly help me?

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

    (@sterndata)

    Volunteer Forum Moderator

    Check your .htaccess file, as well as your apache config file to see if a PHP version has been specified. This is an OS config issue, not a WP one.

    Dion

    (@diondesigns)

    You’re using mod_php, which makes it possible to run different CLI and web-facing versions of PHP. (Note for the future….do NOT check the PHP version in the CLI, only check it in web-facing applications.)

    You can probably fix the issue by defining the correct PHP handler in a .htaccess file. The handler will be defined in the main httpd.conf file if it’s not in a .htaccess file.

    Thread Starter neurotrader

    (@neurotrader)

    Hi Steve and Dion

    Thank you for the Answers!

    @steve, i have seen the answers you have given in other threads before and already tried to change the entry without success.
    in .htaccess there is:
    AddHandler php5-cgi .php
    I changed id to
    AddHandler php74-cgi .php without success ??

    Can you tell me the correct line i have to add in .htaccess?

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I’m not a Debian user — I do better in Fedora and CentOS. Probably best to take this up on a Debian support forum.

    Thread Starter neurotrader

    (@neurotrader)

    Thank you!

    Thread Starter neurotrader

    (@neurotrader)

    I have found the following solution to my “problem”, maybe it will help someone else.

    After installing the new PHP version, the old version must be disabled for Apache with
    “a2dismode phpx.x” x or x.x means old version number

    and the new version must be enabled with
    “a2enmode php7.4”

    That’ s all!

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