PHP 8 warnings using up RAM on Ubuntu 18.04

Plan to upgrade to 20.04 when the system is stable.

Believe what is happening is that a number of *.so files are missing from a PHP directory. /usr/lib/php/20151012.
PHP cleanup is in a loop. RAM is fully utilized. Out of Memory killer stops mariadb/mysql. WordPress sites stop working with a 500 error/no connection to the database error.

How can these errors be stopped?

sudo php -v
PHP 8.0.3 (cli) (built: Mar 5 2021 08:36:11) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies

May 25 11:09:09 systemd[1]: Started Clean php session files.
May 25 11:12:43 systemd[1]: Starting Daily apt download activities…
May 25 11:12:59 systemd[1]: Started Daily apt download activities.
May 25 11:15:01 CRON[30190]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 25 11:17:02 CRON[30200]: (root) CMD ( cd / && run-parts --report /etc/cron.hourly)
May 25 11:25:01 CRON[31267]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 25 11:35:01 CRON[31286]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
May 25 11:39:01 CRON[31291]: (root) CMD ( [ -x /usr/lib/php/sessionclean ] && if [ ! -d /run/systemd/system ]; then /usr/lib/php/sessionclean; fi)
May 25 11:39:08 systemd[1]: Starting Clean php session files…
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysqlnd.so' - /usr/lib/php/20151012/mysqlnd.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xml.so' - /usr/lib/php/20151012/xml.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/curl.so' - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/dom.so' - /usr/lib/php/20151012/dom.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysqli.so' - /usr/lib/php/20151012/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pdo_mysql.so' - /usr/lib/php/20151012/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/simplexml.so' - /usr/lib/php/20151012/simplexml.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/wddx.so' - /usr/lib/php/20151012/wddx.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xmlreader.so' - /usr/lib/php/20151012/xmlreader.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xmlwriter.so' - /usr/lib/php/20151012/xmlwriter.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xsl.so' - /usr/lib/php/20151012/xsl.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysqlnd.so' - /usr/lib/php/20151012/mysqlnd.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xml.so' - /usr/lib/php/20151012/xml.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/curl.so' - /usr/lib/php/20151012/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/dom.so' - /usr/lib/php/20151012/dom.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/mysqli.so' - /usr/lib/php/20151012/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/pdo_mysql.so' - /usr/lib/php/20151012/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/simplexml.so' - /usr/lib/php/20151012/simplexml.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/wddx.so' - /usr/lib/php/20151012/wddx.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xmlreader.so' - /usr/lib/php/20151012/xmlreader.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xmlwriter.so' - /usr/lib/php/20151012/xmlwriter.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:08 sessionclean[31292]: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/20151012/xsl.so' - /usr/lib/php/20151012/xsl.so: cannot open shared object file: No such file or directory in Unknown on line 0
May 25 11:39:09 systemd[1]: Started Clean php session files.

6 Replies

You need to install some PHP 8.0 extensions:

  • mysqli;
  • xml;
  • wddx;

etc.

BTW, 20.04 has been out for 2 years…superseded by 22.04…. Typo?

— sw

No progress yet.
Had errors the packages were not available or already up to date.
Became confused in checking repositories.
Stopped short of adding ppa:ondrej/php.

sudo apt -a list php
Listing… Done
php/now 2:8.0+82+0~20210313.35+debian9~1.gbpa8195f all [installed,local]
php/bionic,bionic 1:7.2+60ubuntu1 all

apt policy
Package files:
100 /var/lib/dpkg/status
release a=now
500 http://apt-longview.linode.com bionic/main i386 Packages
release v=18.04,o=Linode.com,a=stable,n=bionic,l=Linode Longview Repo,c=main,b=i386
origin apt-longview.linode.com
500 http://apt-longview.linode.com bionic/main amd64 Packages
release v=18.04,o=Linode.com,a=stable,n=bionic,l=Linode Longview Repo,c=main,b=amd64
origin apt-longview.linode.com
500 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic/main i386 Packages
release v=18.04,o=LP-PPA-certbot-certbot,a=bionic,n=bionic,l=Certbot PPA,c=main,b=i386
origin ppa.launchpad.net
500 http://ppa.launchpad.net/certbot/certbot/ubuntu bionic/main amd64 Packages
release v=18.04,o=LP-PPA-certbot-certbot,a=bionic,n=bionic,l=Certbot PPA,c=main,b=amd64
origin ppa.launchpad.net
500 https://updates.atomicorp.com/channels/atomic/ubuntu bionic/main amd64 Packages
release o=Atomicorp,n=bionic,l=Atomic yum/apt repo,c=main,b=amd64
origin updates.atomicorp.com
500 http://archive.ubuntu.com/ubuntu bionic/universe i386 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=i386
origin archive.ubuntu.com
500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=amd64
origin archive.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/multiverse i386 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=multiverse,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=multiverse,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/universe i386 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=universe,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=universe,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/restricted i386 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=restricted,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=restricted,b=amd64
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/main i386 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=i386
origin security.ubuntu.com
500 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-security,n=bionic,l=Ubuntu,c=main,b=amd64
origin security.ubuntu.com
100 http://mirrors.linode.com/ubuntu bionic-backports/universe i386 Packages
release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=universe,b=i386
origin mirrors.linode.com
100 http://mirrors.linode.com/ubuntu bionic-backports/universe amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=universe,b=amd64
origin mirrors.linode.com
100 http://mirrors.linode.com/ubuntu bionic-backports/main i386 Packages
release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=main,b=i386
origin mirrors.linode.com
100 http://mirrors.linode.com/ubuntu bionic-backports/main amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-backports,n=bionic,l=Ubuntu,c=main,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/multiverse i386 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=multiverse,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/multiverse amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=multiverse,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/universe i386 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=universe,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/universe amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=universe,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/restricted i386 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=restricted,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/restricted amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=restricted,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/main i386 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic-updates/main amd64 Packages
release v=18.04,o=Ubuntu,a=bionic-updates,n=bionic,l=Ubuntu,c=main,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/multiverse i386 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=multiverse,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/multiverse amd64 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=multiverse,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/universe i386 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/universe amd64 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=universe,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/restricted i386 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/restricted amd64 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=restricted,b=amd64
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/main i386 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=i386
origin mirrors.linode.com
500 http://mirrors.linode.com/ubuntu bionic/main amd64 Packages
release v=18.04,o=Ubuntu,a=bionic,n=bionic,l=Ubuntu,c=main,b=amd64
origin mirrors.linode.com
Pinned packages:
openssl -> 1.1.1-1ubuntu2.1~18.04.17 with priority 1000
openssl -> 1.1.0g-2ubuntu4 with priority 1000
libssl-dev -> 1.1.1-1ubuntu2.1~18.04.17 with priority 1000
libssl-dev -> 1.1.0g-2ubuntu4 with priority 1000
libssl-doc -> 1.1.1-1ubuntu2.1~18.04.17 with priority 1000
libssl-doc -> 1.1.0g-2ubuntu4 with priority 1000
libssl1.1 -> 1.1.1-1ubuntu2.1~18.04.17 with priority 1000
libssl1.1 -> 1.1.0g-2ubuntu4 with priority 1000

Stopped short of adding ppa:ondrej/php.

This is prob what you're going to have to do. The released version of PHP on 18.04 is 7.2. You're not going to find a Canonical-sanctioned release of PHP for 18.04 greater than that.

@acanton77 & I went over this in great detail here:

https://www.linode.com/community/questions/22264/how-do-i-upgrade-to-latest-phpmyadmin-on-ubunut-2004

-- sw

Going around in circles making things worse.

sudo add-apt-repository ppa:ondrej/apache2
Had PHP 8.1
php8.1-mysql: php_invoke mysqlnd: already enabled for PHP 8.1 cli sapi
php8.1-mysql: php_invoke mysqlnd: already enabled for PHP 8.1 apache2 sapi
php8.1-mysql: php_invoke mysqli: already enabled for PHP 8.1 cli sapi
php8.1-mysql: php_invoke mysqli: already enabled for PHP 8.1 apache2 sapi
php8.1-mysql: php_invoke pdo_mysql: already enabled for PHP 8.1 cli sapi
php8.1-mysql: php_invoke pdo_mysql: already enabled for PHP 8.1 apache2 sapi

sudo apt purge '^php7.4.*' = website stopped working. “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”

sudo apt purge '^php8.1.*'
rebooted, no change.

removed /etc/php/7.4/apache2/php.ini
rebooted
no php.ini created

php -v
PHP 7.4.29 (cli) (built: Apr 21 2022 10:16:17) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies

Stuck on “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”

Stuck on “Your PHP installation appears to be missing the MySQL extension which is required by WordPress”

I hate to sound like a broken record here but the only Canonical-sanctioned version of PHP on Ubuntu 18.04 is 7.2!!!

You need to purge all the PPA versions you installed and install that one…which, I guarantee, includes the mysql extension(s).

With PPAs you are on your own…which is ok if you know what you're doing. No offense here but you're flailing…

It's time to reset back to what you had when you started and plotting a logical and rational strategy for what you want to do. A few pencils and a few sheets of paper will be very handy in this process…

-- sw

Have WordPress working again.
Will be watching RAM usage from PHP errors. The initiating issue.
Solved by installing mysqli, a new-ish MySQL/Mariadb driver. Installing php8.1-mysqli was not enough.
sudo apt install php7.4-mysql
sudo systemctl restart apache2

Problem encountered yesterday was removing PHP 7.4 broke WordPress.
Had PHP 8.1, thought I could do without 7.4, ran to serious trouble.
Installed 7.4, for some reason it was not seen. Now have a mix of 7.4 and 8.1.
WordPress was at 6.0, so would not be an issue.
Trouble with: not seeing how to get a PHP version seen by WordPress. Specifically, what the missing extension would be.
Extra modules are listed here, but had not fixed the issue. https://www.linode.com/docs/guides/how-to-install-a-lamp-stack-on-ubuntu-18-04/ The note in the PHP section.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct