Some extensions are missing in PHP 7.4.0: zip, gmp, sodium

Hello,

My tests are failing in 7.4 right now because php’s zip extension isn’t available.

I tried following the instructions for “Enabling preinstalled PHP extensions” but got this:

PHP Warning: PHP Startup: Unable to load dynamic library ‘zip.so’ (tried: /home/travis/.phpenv/versions/7.4.0/lib/php/extensions/no-debug-zts-20190902/zip.so (/home/travis/.phpenv/versions/7.4.0/lib/php/extensions/no-debug-zts-20190902/zip.so: cannot open shared object file: No such file or directory), /home/travis/.phpenv/versions/7.4.0/lib/php/extensions/no-debug-zts-20190902/zip.so.so (/home/travis/.phpenv/versions/7.4.0/lib/php/extensions/no-debug-zts-20190902/zip.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0

When reporting problems, please include relevant build URLs. Thanks.

Sorry, these should be helpful.

I have the same problem with GMP and env 7.x.
Project is here: https://github.com/BitcoinPHP/BitcoinECDSA.php

I’ve updated the subject of this topic so that we can discuss missing extensions generally.

For zip, we are building libzip.so for 7.4.0 (this might be a change from PHP itself), not zip.so, which something is trying to use. Not sure how best to address this apparent discrepancy.

This doesn’t look like a recent change, so I am not sure what’s going on.

Looks like the option --enable-zip has been changed to --with-zip on PHP 7.4.0.
https://www.php.net/manual/en/migration74.other-changes.php#migration74.other-changes.pkg-config

But the build command line was set to --enable-zip (seen at ./home/travis/.phpenv/versions/7.4.0/bin/php-config)

1 Like

try to install using pecl install zip fails, as seen on:
https://travis-ci.org/phpcfdi/sat-ws-descarga-masiva/jobs/621756169#L291

checking PHP version... 7.4
checking for pkg-config... /usr/bin/pkg-config
checking for libzip... not found
configure: error: Please reinstall the libzip distribution
ERROR: `/tmp/pear/install/zip/configure --with-php-config=/home/travis/.phpenv/versions/7.4.0/bin/php-config' failed

The options from 7.4snapshot were fine, you can see there that ./home/travis/.phpenv/versions/7.4snapshot/bin/php-config contains --with-zip.

This are the significant changes from 7.4snapshot to 7.4.0 on php-config:

--- 7.4snapshot-co	2019-12-06 13:55:21.118460897 -0600
+++ 7.4.0-co	2019-12-06 13:47:47.403134610 -0600
@@ -8,13 +8,15 @@
  '--enable-intl'
  '--with-openssl'
  '--without-pear'
- '--enable-gd'
- '--with-jpeg'
- '--with-freetype'
+ '--with-gd'
+ '--with-jpeg-dir=/usr'
+ '--with-png-dir=/usr'
+ '--with-freetype-dir=/usr'
  '--enable-exif'
- '--with-zip'
+ '--enable-zip'
  '--with-zlib'
  '--with-zlib-dir=/usr'
+ '--with-mcrypt=/usr'
  '--with-pdo-sqlite'
  '--enable-soap'
  '--enable-xmlreader'
@@ -26,6 +28,7 @@
  '--enable-sysvshm'
  '--enable-sysvmsg'
  '--enable-shmop'
+ '--with-mysql=mysqlnd'
  '--with-mysqli=mysqlnd'
  '--with-pdo-mysql=mysqlnd'
  '--enable-pcntl'
@@ -51,9 +54,9 @@
  '--enable-dba'
  '--with-cdb'
  '--with-libzip=/home/travis/.phpenv/versions/7.4.0'
- '--with-sodium=/home/travis/.phpenv/versions/7.4.0'
+ '--with-libsodium=/home/travis/.phpenv/versions/7.4.0'
  '--with-password-argon2=/home/travis/.phpenv/versions/7.4.0'
- 'PKG_CONFIG_PATH=/home/travis/.phpenv/versions/7.4.0/lib/pkgconfig:'
+ 'PKG_CONFIG_PATH=/lib/pkgconfig:'
  'ONIG_CFLAGS=-I/home/travis/build/travis-ci/php-src-builder/onig/src'
  'ONIG_LIBS=-L/home/travis/build/travis-ci/php-src-builder/onig/src/.libs
  -l:libonig.a'"

While PHP 7.4 testing is broken on Travis CI we have enabled allowed failures for PHP 7.4. https://github.com/drupal-graphql/graphql/pull/955 That way we still see how 7.4 is doing during test runs while it does not fail our build.

Let me know once the GD extension is working, then we can run PHP 7.4 for real.

Where do I add the --with-gmp compiler flag in the travis.yml file?

We can’t test Laravel Dusk atm because of the missing zip extension: https://travis-ci.org/laravel/dusk/builds/622684841?utm_source=github_status&utm_medium=notification

As pecl install zip doesn’t works either, there isn’t an alternative way to solve this atm afaik.

I’ve refreshed PHP 7.4 binaries, with a few changes to the configurations. Please test them.

1 Like

Awesome! It’s working

1 Like

Thank you for the report!

How about you? Have you had a chance to test it yet?

Thank you PHP 7.4 seems to be working now and our remaining test fails are due to the fact that Drupal core is not 7.4 compatible yet in https://www.drupal.org/project/drupal/issues/3086374 :slight_smile:

1 Like

Sweet! Thanks for the report.

1 Like

All builds are now passing. Thanks for the fast action!

1 Like

We’re still experiencing problems with GD in php 7.4

see: https://travis-ci.org/Elgg/Elgg/jobs/626700668#L504