• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • Support for BIND DNS has been removed from Plesk for Windows due to security and maintenance risks.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS.

Question clobbered PHP-CLI after apt upgrade

James Heinrich

New Pleskian
Server operating system version
Ubuntu 22.04.5 LTS (GNU/Linux 5.15.0-139-generic x86_64)
Plesk version and microupdate number
Plesk Obsidian 18.0.69 Update #2, Web Host Edition
I noticed the automated "Package Update Manager notification" emails contained an error message for the last few days ("ERROR: Apt cache fetch failed: E:Repository 'Index of /ondrej/php/ubuntu jammy InRelease' changed its 'Label' value from '***** The main PPA for supported PHP versions with many PECL extensions *****' to 'PPA for PHP'"). Looking in Plesk I noticed it had failed to check for updates since 2025-Apr-27 (presumably due to the above error). Attempting to fix this, I manually ran "apt update" and confirmed that I wanted to use the new name. I believe I then also ran "apt upgrade" and it installed some updates. And I think that was my mistake.

Now, later the same day, I'm getting emails "Cron <root@servername> cd / && run-parts --report /etc/cron.hourly" with message contents:
/etc/cron.hourly/plesk-php-cleanuper:
/usr/lib/plesk-9.0/maxlifetime: line 16: [:
Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
1440: integer expression expected
/usr/lib/plesk-9.0/maxlifetime: line 16: [:
Deprecated: PHP Startup: session.sid_length INI setting is deprecated in Unknown on line 0

Deprecated: PHP Startup: session.sid_bits_per_character INI setting is deprecated in Unknown on line 0
1440: integer expression expected

And then I tried to run a PHP script that connects to a MariaDB database (which worked perfectly fine yesterday) and it tells me:
"PHP Fatal error: Uncaught Error: Class "mysqli" not found in ..."
I tried enabling mysqli extension in /etc/php/8.4/cli/php.ini without success (all the extensions are commented-out there)


So I think I unwittingly clobbered the Plesk PHP-CLI installation (which may have been v7.4 but I'm not certain) and now I've got PHP 8.4.6 which it certainly wasn't before.
The question is either:
a) how do I revert the PHP-CLI configuration to what Plesk is expecting
or
b) how do I make PHP 8.4.6 play nice with Plesk and my command-line calls to scripts that require mysqli and/or other extensions.

Assume there is no viable Plesk backup available. I tried the Plesk "Diagnose & Repair" extension and it did not help.
 
Partly answering (b) above, this seems to solve my CLI issues
apt install php8.4-mbstring
apt install php8.4-mysql

However, the Plesk issue remains, where I get hourly emails about plesk-php-cleanuper failing due to deprecated ini settings.
 
I believe I then also ran "apt upgrade" and it installed some updates. And I think that was my mistake.
Are you sure you didn't run autoremove? This looks like plesk-php* packages were removed.
AFAIK plesk's scripts run /opt/plesk/php/7.4/bin/php directly without going through /etc/alternatives/php, so just php8.4 taking over the alternatives shouldn't affect plesk, but it DOES affect cli.
 
I'm fairly certain I didn't run autoremove.
apt list --installed shows a bunch of "plesk-php74*" (including plesk-php74 and plesk-php74-cli, plus all the extensions). There's also the equivalent entries for "plesk-php83" and "plesk-php84".
Under non-Plesk PHP entries, there's php-cli, php-common, then several extensions for each of php8.1-*, php8.3-*, php8.4-*

But as I mentioned in my last post, I've got the CLI portion of my problem working correctly now, and the websites and Plesk GUI were never broken, the current only symptom I have is that every hour I get the email from /etc/cron.hourly/plesk-php-cleanuper (quoted in my first post). That script contains this:
Code:
#!/bin/sh
### Copyright 1999-2025. WebPros International GmbH. All rights reserved.

#  This purges session files older than X, where X is defined in seconds
#  as the largest value of session.gc_maxlifetime from all your php.ini
#  files, or 24 minutes if not defined.  See ${maxlifetime}

# Look for and purge old sessions every hour

pgrep -f ".*$0$" | grep -qv $$ && exit 0

renice 19 -p $$ >/dev/null 2>&1

[ -x /usr/lib/plesk-9.0/maxlifetime ] && [ -d /var/lib/php/sessions ] && /usr/lib/plesk-9.0/php_session_cleaner /var/lib/php/sessions $(/usr/lib/plesk-9.0/maxlifetime)
Presumably it's running on PHP 8.4 now that's why it's unhappy, but I don't know where it's finding those ini settings it does like (session.sid_length, session.sid_bits_per_character)?
 
But as I mentioned in my last post, I've got the CLI portion of my problem working correctly now, and the websites and Plesk GUI were never broken, the current only symptom I have is that every hour I get the email from /etc/cron.hourly/plesk-php-cleanuper (quoted in my first post).
Do you use the full part to the php binary you need now, or what was your CLI solution?

In /usr/lib/plesk-9.0/maxlifetime I see:
Bash:
if [ -d "/etc/php/7.4" ] ; then
        for d in `find "/etc/php/7.4" -mindepth 1 -maxdepth 1 -type d`; do
                update_max_lifetime "/usr/bin/php" "$d/php.ini" "$d/conf.d"
        done
fi

# check Plesk php as well
if [ -d /opt/plesk/php ] ; then
        for d in `find /opt/plesk/php/ -mindepth 1 -maxdepth 1 -type d`; do
                update_max_lifetime "$d/bin/php" "$d/etc/php.ini" "$d/etc/php.d"
        done
fi

Note that in the latter case "$d/bin/php" is used to run exactly the php version that matches the respective ini, but in the former case, it uses "usr/bin/php". I would consider this a bug, BTW. It should use /usr/bin/php7.4.

Installing php8.4 installed an alternative with priority 84, becoming the choice in auto mode. Use update-alternatives --config php to manually change /usr/bin/php back to php7.4.
 
In my case the first block references php/8.1 rather than php/7.4 (but has the same hardcoded /usr/bin/php). And I do have /etc/php/8.1 (and 8.3 and 8.4) but in /usr/bin/ there's only php8.3 and php8.4 (no php8.1). I also see /usr/bin/php -> /etc/alternatives/php and /usr/bin/php.default -> php8.4

Update-alternatives shows me:
Code:
update-alternatives --config php
There are 3 choices for the alternative php (providing /usr/bin/php).

  Selection    Path                  Priority   Status
------------------------------------------------------------
* 0            /usr/bin/php.default   100       auto mode
  1            /usr/bin/php.default   100       manual mode
  2            /usr/bin/php8.3        83        manual mode
  3            /usr/bin/php8.4        84        manual mode
 
But you don't have the package php7.4-cli installed? That's the one plesk wants to run in that script because it thinks it is there as there obviously is an /etc/php/7.4 in your system, otherwise it wouldn't try to run that part.
 
I do have plesk-php74-cli (and plesk-php74 and assorted plesk-php74-* extensions) installed (according to apt list).
In Plesk GUI > Tools & Settings > PHP Settings I have 7.4, 8.3, 8.4 available.
I do not have non-Plesk php7.4-* installed, just 8.1, 8.3, 8.4
Code:
php-cli/jammy,jammy,now 2:8.4+96+ubuntu22.04.1+deb.sury.org+1 all [installed]
php-common/jammy,jammy,now 2:96+ubuntu22.04.1+deb.sury.org+1 all [installed,automatic]
php8.1-bz2/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.1-common/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.1-curl/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.1-gmp/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.1-mbstring/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.1-mysql/jammy,now 8.1.32-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-bz2/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-cli/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,auto-removable]
php8.3-common/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.3-curl/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-gmp/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-intl/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-mbstring/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-mysql/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.3-opcache/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,auto-removable]
php8.3-readline/jammy,now 8.3.20-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,auto-removable]
php8.4-cli/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.4-common/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.4-curl/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.4-gmp/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.4-mbstring/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.4-mysql/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed]
php8.4-opcache/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
php8.4-readline/jammy,now 8.4.6-1+ubuntu22.04.1+deb.sury.org+1 amd64 [installed,automatic]
plesk-php74-bcmath/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-cli/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-dba/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-enchant/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-fpm/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-gd/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-imagick/jammy,now 3.7.0-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-imap/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-intl/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-ioncube-loader/jammy,now 11.0.1-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-ldap/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-mbstring/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-mysql/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-odbc/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-opcache/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-pdo/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-pear/jammy,now 1.10.13-ubuntu.22.04.240507.1400 all [installed]
plesk-php74-pgsql/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-process/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-pspell/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-redis/jammy,now 5.3.7-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-snmp/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-soap/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-sodium/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-tidy/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-xdebug/jammy,now 3.1.5-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-xml/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74-xmlrpc/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php74/jammy,now 7.4.33-ubuntu.22.04.240507.1400 amd64 [installed]
plesk-php83-bcmath/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-cli/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-dba/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-enchant/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-fpm/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-gd/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-imagick/jammy,now 3.8.0-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-imap/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-intl/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-ldap/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-mbstring/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-mysql/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-odbc/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-opcache/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-pdo/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-pear/jammy,now 1.10.16-ubuntu.22.04.250411.1143 all [installed]
plesk-php83-pgsql/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-process/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-pspell/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-redis/jammy,now 6.2.0-ubuntu.22.04.250411.1554 amd64 [installed]
plesk-php83-snmp/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-soap/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-sodium/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-tidy/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-xdebug/jammy,now 3.4.2-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83-xml/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php83/jammy,now 8.3.20-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-bcmath/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-cli/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-dba/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-enchant/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-fpm/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-gd/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-imagick/jammy,now 3.8.0-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-imap/jammy,now 1.0.3-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-intl/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-ldap/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-mbstring/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-mysql/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-odbc/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-opcache/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-pdo/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-pear/jammy,now 1.10.16-ubuntu.22.04.250411.1143 all [installed]
plesk-php84-pgsql/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-process/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-pspell/jammy,now 1.0.1-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-redis/jammy,now 6.2.0-ubuntu.22.04.250411.1554 amd64 [installed]
plesk-php84-snmp/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-soap/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-sodium/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-tidy/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-xdebug/jammy,now 3.4.2-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84-xml/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-php84/jammy,now 8.4.6-ubuntu.22.04.250411.1143 amd64 [installed]
plesk-phpenv/now 0.9.0-v.ubuntu.22.04+p18.0.68.0+t250205.1631 all [installed,local]
psa-phpmyadmin/now 5.2.2-v.ubuntu.22.04+p18.0.69.0+t250307.1315 all [installed,local]

In /etc/php there is 8.1, 8.3, 8.3 (no 7.4)
 

Attachments

  • phphandler.png
    phphandler.png
    62.5 KB · Views: 0
("ERROR: Apt cache fetch failed: E:Repository 'Index of /ondrej/php/ubuntu jammy InRelease' changed its 'Label' value from '***** The main PPA for supported PHP versions with many PECL extensions *****' to 'PPA for PHP'"

The error suggest an issue with the https://ppa.launchpadcontent.net/ondrej/php/ubunturepository. Have you tried disabling it already? If not, I would suggest giving it a try by moving it to the /root folder.
 
That's no longer an issue, as noted in my first post I ran apt update and fixed that changed-label complaint and Plesk updates started working again.
The remaining issue is session.sid_length and session.sid_bits_per_character "INI setting is deprecated" warnings in /etc/cron.hourly/plesk-php-cleanuper which is presumably now running under PHP 8.4
 
Back
Top