Page MenuHomePhabricator

php 7.2 causes 'php update.php' to fail with "Error: Missing one or more required components"
Closed, InvalidPublic

Description

Running Archlinux, php 7.2.2

Upgrading from 1.23.3 to 1.30.0 with 123.3 running fine, I followed the update procedure to the point of https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script (run the update script) Upon running 'php update.php' (as root) the following error is received:

PHP Warning:  PHP Startup: Unable to load dynamic library 'mcrypt.so' (tried: /usr/lib/php/modules/mcrypt.so (/usr/lib/php/modules/mcrypt.so: undefined symbol: spprintf), /usr/lib/php/modules/mcrypt.so.so (/usr/lib/php/modules/mcrypt.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'mysql.so' (tried: /usr/lib/php/modules/mysql.so (/usr/lib/php/modules/mysql.so: cannot open shared object file: No such file or directory), /usr/lib/php/modules/mysql.so.so (/usr/lib/php/modules/mysql.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library 'openssl.so' (tried: /usr/lib/php/modules/openssl.so (/usr/lib/php/modules/openssl.so: cannot open shared object file: No such file or directory), /usr/lib/php/modules/openssl.so.so (/usr/lib/php/modules/openssl.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
Error: Missing one or more required components of PHP.
You are missing a required extension to PHP that MediaWiki needs.
Please install:
 * iconv <https://secure.php.net/iconv>

The warnings are a bit strange as mcrypt.so is present

# ls -al  /usr/lib/php/modules/mcrypt.so
-rwxr-xr-x 1 root root 42912 Nov 22 10:53 /usr/lib/php/modules/mcrypt.so

iconv is also present

# ls -al /usr/lib/php/modules/iconv.so
-rwxr-xr-x 1 root root 42944 Jan 30 12:20 /usr/lib/php/modules/iconv.so

I haven't looked at the php source or that of update.php, but it appears there is something with php 7.2 that update does not play nicely with. (I am also guessing at the 'periodic-update' tag so please change it if that is not correct.

Event Timeline

The hint for mcrypt.so is

undefined symbol: spprintf

Thus, mcrypt.so cannot be loaded (and appending another .so leads to a missing file). You probably have a mcrypt.so for an older php version installed. Try installing php71-mcrypt

As for iconv, is it configured on php.ini to be loaded ?

@Drankinatty Have you upgrade to PHP 7.2 from other earlier versions?

All, I found the issue and I apologize for the noise. Due to other groupware packages I have both php 7.2 and php 5.6-32 installed. (which runs as /usr/bin/php56 with separate config in /etc/php56). The problem is apache is autoloading modules for php56. So it seems the solution here is to upgrade.php with php56.

Please close this bug -- (I'll look to see if I can do it, if not, just nuke it for me)