Problem:
When using the docker-php-ext-install or docker-php-ext-configure scripts in older versions of the cimg/php convenience image, users may encounter a 503 error from curl when downloading the source code. This can also cause the additional error cd: /usr/src/php/ext: No such file or directory. The script has been updated and will be present in later versions of the images 8.4 and 8.5.
The root cause of the issue is present in the docker-php-source script.
Solutions:
Update the script manually
- The updated script is available here.
Using the custom run step before using either of the extension scripts the old version can be overwritten:
- run: name: "Update docker-php-source" command: | curl -sSL "https://raw.githubusercontent.com/CircleCI-Public/cimg-php/refs/heads/main/docker-php-scripts/docker-php-source" -o docker-php-source chmod +x docker-php-source sudo mv docker-php-source /usr/local/bin
Patching the download link in place
- If the above is not possible you can patch the download script in place, however, the above step is recommended as it provides more failover addresses.
This step will replace the download URL with one consistent with the updated script.
- run: name: "Patch docker-php-source" command: | sudo sed -i 's|^PHP_URL=.*|PHP_URL="https://github.com/php/php-src/archive/refs/tags/php-${PHP_VER}.tar.gz"|' /usr/local/bin/docker-php-source sudo sed -i 's|-Jxf|-xzf|' /usr/local/bin/docker-php-source sudo sed -i 's|.tar.xz|.tar.gz|' /usr/local/bin/docker-php-source
Outcome:
The script will now be updated with new links to download the PHP source code which will work around the 503 error which was causing workflows to fail.
Additional Notes:
Old versions of our convenience images do not always get new releases thus this patch may be required going forward. Updating to newer versions of the image will alleviate this problem.
Comments
Article is closed for comments.