CircleCI-Public / cimg-php

The CircleCI PHP Docker image. Based on the `cimg/base` image.
https://circleci.com/developer/images/image/cimg/php
MIT License
12 stars 16 forks source link

Can you test the PHP v8.0.12 image? #126

Closed FelicianoTech closed 2 years ago

FelicianoTech commented 3 years ago

Hey everyone!

Some of you may have noticed that we haven’t published a PHP image for a few new releases now. We’re a bit behind due to an issue we’re having with the prepacked PHP releases we were using. We’re switching the image to use custom-compiled PHP instead.

Can you help test it?

Of the releases we haven’t published yet, we’ve published PHP v8.0.12 as a test image (cimg/php:8.0.12). If you can, please use this image for your build to let us know if it works for you the way a previous cimg/php: image has or even the legacy PHP image circleci/php:. Specifically, I want to make sure we’re not missing any PHP extensions that we’ve may have had in a previous image.

shadowhand commented 2 years ago

The new image is missing --enable-sockets, per https://www.php.net/manual/en/sockets.installation.php. This was previously available.

The previous way of installing PCOV no longer works:

apt install -y php8.0-pcov
<truncated>
E: Unable to locate package php8.0-pcov
E: Couldn't find any package by glob 'php8.0-pcov'
E: Couldn't find any package by regex 'php8.0-pcov'

Exited with code exit status 100
tmannherz commented 2 years ago

The ext-zip extension is also missing:

8.0.11

λ docker run cimg/php:8.0.11-node php -i | grep "zip"
/etc/php/8.0/cli/conf.d/20-zip.ini
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip
gzip compression => enabled
bzip2 compression => disabled (install ext/bz2)
zip
Libzip version => 1.7.3

8.0.13

λ docker run cimg/php:8.0.13-node php -i | grep "zip"
Configure Command =>  './configure'  '--enable-bcmath' '--enable-mbstring' '--enable-phpdbg' '--enable-zip' '--with-curl' '--with-gd' '--with-mysqli' '--with-pdo-mysql' '--with-pdo-pgsql' '--with-pgsql' '--with-openssl' '--with-readline' '--with-zlib'
gzip compression => enabled
bzip2 compression => disabled (install ext/bz2)

Notice that Libzip version => 1.7.3 isn't present in the latest tag.

shadowhand commented 2 years ago

I appreciate that the goal of this change was to provide more timely updates to the cimg/php Docker image. However, I am of the opinion that this is a massive breaking change. The "issue" of a specific release not being immediately available on ppa:ondrej/php is not worth the headache this is causing for users, in that:

As a fellow open source maintainer, I strongly recommend reverting these changes, removing cimg/php:8.0.12, and switching back to an established PHP distribution.

FelicianoTech commented 2 years ago

The new image is missing --enable-sockets

I'll get that going in a respin of the images shortly.

The previous way of installing PCOV no longer works:

@shadowhand The method of using apt packages for php extensions won't work in these new images as we don't rely on any of those packages. Unless you have a better idea, I imagine the best method for installation would be with pecl/pear, which isn't in the image at the moment. I can get that in an update today as well.

The ext-zip extension is also missing

Checking

I appreciate that the goal of this change was to provide more timely updates to the cimg/php Docker image. However, I am of the opinion that this is a massive breaking change.

@shadowhand I understand, which is why we're going to fix as much as possible here on what's broken. To answer your question from the other GitHub Issue, we can't use the PPA because 1) sometimes the new versions take longer than we need and 2) they remove older versions that we need. We have images that we need to rebuild/fix that we literally cannot because those versions are no longer available in the PPA. That's not acceptable for our use case in order for us to provide support for these images in the future.

There's some bugs, and docs can be added for the lack of apt packages, yes, and we will do that. We'll do our best to get this to a place that works for CircleCI as well as the users.

FelicianoTech commented 2 years ago

Updated images are building. They're be out soon. I'll update here when that happens.

a-songac commented 2 years ago

Thank you @felicianotech for the work you do on this repo and I now understand better the rationale of the change following your previous replies. Just a heads up, the ext-sodium and ext-pcntl extensions are also missing in the new image.

Indeed, a well documented method to add custom extensions now that relying on the PPA is no longer available will be needed.

Thanks again for your work.

FelicianoTech commented 2 years ago

Three of the six new image tags have been updated with changes from this thread. The other 3 will be published within 30 minutes. A quick summary:

I'll check back in next week so we can see if this addresses everything or if there's more tweaks to be made. Then the readme will be updated with suggestions on use, for example, using pecl to install something.

shadowhand commented 2 years ago

@felicianotech Thanks for the swift response to the issues raised. I appreciate the reasoning for making this change, even though it has caused some growing pains.

I found a couple of additional issues after testing the new images again...

Running pecl install pcov works, but there are some warnings. At the beginning:

WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update pecl.php.net" to update

And at the end:

configuration option "php_ini" is not set to php.ini location
You should add "extension=pcov.so" to php.ini

It appears that pear/pecl need a config set (which has been removed?):

pear config-set php_ini /etc/php.d/circleci.ini

For now I have added this to my config.yml and it seems to be working:

sudo pear config-set php_ini /etc/php.d/circleci.ini && \
sudo pecl update-channels && \
sudo pecl install pcov
tmannherz commented 2 years ago

I can confirm that zip is now available.

FelicianoTech commented 2 years ago

The comments about the pear config have been taken care of. SOAP support was also added. As far as I can tell, anything missing or broken mentioned in this thread were taken care of a few days ago with the final pass adding SOAP. I'll leave this issue open for a bit more to collect any last minute feedback but I think we're good to go here.

qboot commented 2 years ago

Hello! We are using some PHP extensions with the cimg/php:8.0-node and our circleci build recently failed.

After dig in a bit, we found this issue which is exactly our problem.

We install some extensions with:

sudo apt update && sudo apt install -y php8.0-redis php8.0-apcu php8.0-amqp php8.0-imagick php8.0-intl php8.0-mysql php8.0-uuid

I tried to use pecl instead apt as you have suggested in the comments above:

sudo pecl install redis apcu amqp imagick intl uuid

But now I have some "library not found" errors:

configure: error: librabbitmq not found
configure: error: libuuid not found

For now, we have forced the use of the cimg/php:8.0.11-node. Can you provide a way to be able to install our required additional extensions with the latest images?

Thanks!

FelicianoTech commented 2 years ago

@JalexChen We use the Docker originated extension install script now right? So I can close this?