Question

php7.4 sql Error - Wordpress site down now.

Posted November 13, 2021 120 views
PHPWordPressSQL

Siiigh. First off, I’m not good at this, for the record.
Second I followed the DO tutorial for updating php to 7.4
But now my sql is just gone and unavailable.

E: Unable to locate package php7.4-mysql
E: Couldn’t find any package by glob ‘php7.4-mysql’
E: Couldn’t find any package by regex 'php7.4-mysql’

So naturally my wordpress site doesn’t work now.

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

I need help. Badly.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
1 answer

Hi there,

Can you confirm the exact Ubuntu version that you are running? You can check that with:

cat /etc/os-release

Feel free to share the output here.

Also which tutorial exactly did you follow and Are you using the ppa:ondrej/php repository?

If this is the case, going through the available PHP 7.4 packages on the repository here:

http://ppa.launchpad.net/ondrej/php/ubuntu/pool/main/p/php7.4/

It looks like that php7.4-mysql package is not available for Ubuntu 20.10.

I could suggest one of the following things:

  • Revert back to the old PHP version that you were using
  • If you are on Ubuntu 20.04 you could try upgrading to 21.04 which seems to have the package.
  • Alternatively, revert to a backup or a snapshot so that you could get your website up and running again as it was with the old version.

Let me know how it goes.

Best,
Bobby

  • Appreciate the reply.

    Version=“16.04.7 LTS (Xenial Xerus)”

    I used these commands:

    sudo apt-get update
    sudo apt -y install software-properties-common
    sudo add-apt-repository ppa:ondrej/php
    sudo apt-get update
    sudo apt-get install php7.4
    sudo apt-get install php7.4-mysql
    php -v (check to make sure PHP 7.4 is installed)
    sudo apt install php7.4-fpm php7.4-common php7.4-mbstring php7.4-xmlrpc php7.4-gd php7.4-xml php7.4-mysql php7.4-cli php7.4-zip php7.4-curl
    sudo a2dismod php7.0
    sudo a2enmod php7.4
    sudo service apache2 restart

    I guess i should upgrade Ubuntu then?

    • Or I can’t upgrade it…

      It aborted. invalid package information. I’m pretty lost now.

      Was using this to upgrade https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-20-04-focal-fossa

      by Brian Boucheron
      The Ubuntu operating system's latest Long Term Support (LTS) release, Ubuntu 20.04 (Focal Fossa), was released on April 23, 2020. This guide will explain how to upgrade an Ubuntu system of version 18.04 or later to Ubuntu 20.04.
      • Hello,

        Upgrading Ubuntu 16.04 LTS to 20.04 LTS can be done by first updating it to Ubuntu 18.04 LTS.

        You can follow the steps here:

        https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-18-04

        However keep in mind that this is a major upgrade, and it is always best to first test your application/website before performing such an upgrade for a live system.

        And of course, as always, make sure that you have a snapshot/backup of your server.

        Alternatively, what you could in order to prevent downtime is to set up a new Ubuntu 20.04 or 21.04 server, install all of the required packages like PHP and etc, migrate your website over and test it on the new server. Then once ready with the testing, you could switch your DNS to point to the new server and only then shut down the old one.

        Best,
        Bobby

        by Brian Boucheron
        <$>[warning] Warning: As with almost any upgrade between major releases of an operating system, this process carries an inherent risk of failure, data loss, or broken software configuration. Comprehensive backups and extensive testing are strongly advised. To avoid...