Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pcntl extension and improve installation of others #9

Merged
merged 5 commits into from
Oct 31, 2020

Conversation

dshoreman
Copy link
Contributor

PHP 8 will remove the pcntl extension from core so it has to be installed manually to get the timing functionality working in phpsu/ShellCommandBuilder#17. While figuring out how to do that, I noticed the other extension steps could also be improved so it's a slightly bigger PR than planned.

Change Summary

  • Added pcntl extension
  • Added --depth 1 to all git clone commands
  • Replaced all cd $ext && phpize && ./configure --foo with docker-php-ext-configure $ext --foo
  • Replaced all make && make install [&& docker-php-ext-enable] with docker-php-ext-install
  • Removed [zend_]extension=foo.so lines from xhprof and xdebug configs
    • These are appended automatically by docker-php-ext-install
  • Updated exposed docker port to match that in php/xdebug.ini

The helper scripts can be found in docker-library/php.

The pcntl module is one of several slated [to be moved out of
core](https://wiki.php.net/rfc/unbunle-unmaintained-extensions-php8) in
php8, so it now needs to be installed/enabled manually.

This fixes the "Error: PHP extension pcntl is required for enforcing
time limits" warning that's triggered by ShellCommandBuilder's tests.
This significantly reduces the complexity of extension installation by
utilising the docker-php-ext-* helper scripts provided by the php image.

Those scripts cd to /usr/src/php/ext where all the other core extensions
are kept, so by cloning there we save a lot of directory jumping too.

The -ext-install script will also add the `extension=*` line, so that's
removed from the custom xhprof.ini to avoid duplicate loading warnings.
Updates the application group step to use the variable when adding it to
sudoers to avoid issues if those variables are changed, and makes use of
PHP_INI_DIR which is already set to /usr/local/etc/php in the php image.
Updates the xdebug step similarly to the previous pcov/xhprof steps to
use the docker-php-ext-* scripts for installation. Rather than manually
extracting the archive, we can simply clone the given tag. Since we're
using --depth 1 for all the clones, it won't fetch unecessary history.

Also removes the chmod which doesn't seem to be needed when the dir is
created directly within the container instead of being a volume.
@dshoreman dshoreman changed the title Add pcntl extension and installation of others Add pcntl extension and improve installation of others Oct 31, 2020
@ChrisB9
Copy link
Owner

ChrisB9 commented Oct 31, 2020

Thank you, those changes look really good!

@ChrisB9 ChrisB9 merged commit b238e83 into ChrisB9:main Oct 31, 2020
@dshoreman dshoreman deleted the pcntl branch October 31, 2020 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants