• Resolved MarkOlbert

    (@markolbert)


    I’m trying to downgrade my sites from php8.1.6 to php7.4. The problem is the change isn’t “taking”: site health/info still shows my sites running 8.1.6.

    This is on debian 10 using apache2.

    Here’s what I’ve done:

    Re-installed 7.4 and all of the needed addons
    Disabled 8.1 via a2dismod php8.1
    Enabled 7.4 via a2enmod php7.4
    Changed the system-wide default via update-alternatives –config php
    Restarted apache2
    Rebooted the server (out of desperation :))

    But WP steadfastly insists on using php8.1.6. php -v, however, reports that it’s using php7.4

    I guess I could just uninstall 8.1.6. But I’d rather keep it around.

    How do I get the change to take? What am I missing?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator threadi

    (@threadi)

    I suspect you still have the wrong PHP version set on the vhost, especially if this is via PHP-FPM can be a reason.

    Your problem has very little to do with WordPress. My recommendation would be that you possibly turn to a community for the Linux distribution you use. The reason is that each server can be configured very individually. You can’t cover all that here in the wordpress support forum.

    Thread Starter MarkOlbert

    (@markolbert)

    Thanx for the quick response. I’d solved the problem in the meanwhile — it did, as you suggested, have to do with php-fpm. Specifically, if you have multiple versions of php-fpm running on a server (which I do) you have to configure your apache config files to specify which one you want apache to use. Otherwise, you get apparently get the most recent one.

    Here’s the necessary configuration for inclusion in the apache conf file for a site:

    # Specify which version of PHP to run since we have several
    

    # (added 6/17/2022 per https://www.digitalocean.com/community/tutorials/how-to-run-multiple-php-versions-on-one-server-using-apache-and-php-fpm-on-ubuntu-18-04)

        <FilesMatch \.php$>
    

    # For Apache version 2.4.10 and above, use SetHandler to run PHP as a fastCGI process server
    ` SetHandler “proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost”
    </FilesMatch>

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

The topic ‘Downrev to PHP7.4 Not Working’ is closed to new replies.