Skinny-Hosts / core-php-fpm-docker-image

Here is the image of PHP-FPM with additional packages and using its Alpine version.
0 stars 0 forks source link

How to add new PHP extensions? #10

Open marcosfreitas opened 2 years ago

marcosfreitas commented 2 years ago

There is an output for missing extensions on a Laravel project:

  Problem 1
    - lcobucci/jwt is locked to version 4.1.5 and an update of this package was not requested.
    - lcobucci/jwt 4.1.5 requires ext-sodium * -> it is missing from your system. Install or enable PHP's sodium extension.
  Problem 2
    - league/flysystem is locked to version 1.1.9 and an update of this package was not requested.
    - league/flysystem 1.1.9 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
  Problem 3
    - league/mime-type-detection is locked to version 1.11.0 and an update of this package was not requested.
    - league/mime-type-detection 1.11.0 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
  Problem 4
    - nikic/php-parser is locked to version v4.14.0 and an update of this package was not requested.
    - nikic/php-parser v4.14.0 requires ext-tokenizer * -> it is missing from your system. Install or enable PHP's tokenizer extension.
  Problem 5
    - psy/psysh is locked to version v0.11.5 and an update of this package was not requested.
    - psy/psysh v0.11.5 requires ext-tokenizer * -> it is missing from your system. Install or enable PHP's tokenizer extension.
  Problem 6
    - simplesoftwareio/simple-qrcode is locked to version 4.2.0 and an update of this package was not requested.
    - simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 7
    - tijsverkoyen/css-to-inline-styles is locked to version 2.2.4 and an update of this package was not requested.
    - tijsverkoyen/css-to-inline-styles 2.2.4 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 8
    - phar-io/manifest is locked to version 2.0.3 and an update of this package was not requested.
    - phar-io/manifest 2.0.3 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 9
    - phpunit/php-code-coverage is locked to version 9.2.15 and an update of this package was not requested.
    - phpunit/php-code-coverage 9.2.15 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 10
    - phpunit/phpunit is locked to version 9.5.20 and an update of this package was not requested.
    - phpunit/phpunit 9.5.20 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 11
    - theseer/tokenizer is locked to version 1.2.1 and an update of this package was not requested.
    - theseer/tokenizer 1.2.1 requires ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
  Problem 12
    - league/flysystem 1.1.9 requires ext-fileinfo * -> it is missing from your system. Install or enable PHP's fileinfo extension.
    - laravel/framework v8.83.16 requires league/flysystem ^1.1 -> satisfiable by league/flysystem[1.1.9].
    - laravel/framework is locked to version v8.83.16 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php8/php.ini
    - /etc/php8/conf.d/00_curl.ini
    - /etc/php8/conf.d/00_iconv.ini
    - /etc/php8/conf.d/00_mbstring.ini
    - /etc/php8/conf.d/00_openssl.ini
    - /etc/php8/conf.d/00_zip.ini
    - /etc/php8/conf.d/01_phar.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-sodium --ignore-platform-req=ext-fileinfo --ignore-platform-req=ext-fileinfo --ignore-platform-req=ext-tokenizer --ignore-platform-req=ext-tokenizer --ignore-platform-req=ext-gd --ignore-platform-req=ext-dom --ignore-platform-req=ext-dom --ignore-platform-req=ext-dom --ignore-platform-req=ext-dom --ignore-platform-req=ext-dom --ignore-platform-req=ext-fileinfo` to temporarily ignore these required extensions.
marcosfreitas commented 2 years ago

The fast response is that We should use this image as a base/builder and in other images call for:

install-php-extensions

However, GD and Imagick are extensions present on the Dockerfile, and this log warns that GD isn't. 🤔

marcosfreitas commented 2 years ago

There is some problem with GD and DOM installations. 😢

As We know, GD is installed by default and I'd add the dom through apk command, but after restarting the container:

bash-5.1# composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires simplesoftwareio/simple-qrcode ^4.2 -> satisfiable by simplesoftwareio/simple-qrcode[4.2.0].
    - simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 2
    - phpunit/phpunit[9.5.10, ..., 9.5.20] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - Root composer.json requires phpunit/phpunit ^9.5.10 -> satisfiable by phpunit/phpunit[9.5.10, ..., 9.5.20].

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php8/php.ini
    - /etc/php8/conf.d/00_curl.ini
    - /etc/php8/conf.d/00_iconv.ini
    - /etc/php8/conf.d/00_mbstring.ini
    - /etc/php8/conf.d/00_openssl.ini
    - /etc/php8/conf.d/00_zip.ini
    - /etc/php8/conf.d/01_phar.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.
marcosfreitas commented 1 year ago

This problem with php extension installations was fixed in the last release.

There is some problem with GD and DOM installations. cry

As We know, GD is installed by default and I'd add the dom through apk command, but after restarting the container:

bash-5.1# composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires simplesoftwareio/simple-qrcode ^4.2 -> satisfiable by simplesoftwareio/simple-qrcode[4.2.0].
    - simplesoftwareio/simple-qrcode 4.2.0 requires ext-gd * -> it is missing from your system. Install or enable PHP's gd extension.
  Problem 2
    - phpunit/phpunit[9.5.10, ..., 9.5.20] require ext-dom * -> it is missing from your system. Install or enable PHP's dom extension.
    - Root composer.json requires phpunit/phpunit ^9.5.10 -> satisfiable by phpunit/phpunit[9.5.10, ..., 9.5.20].

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php8/php.ini
    - /etc/php8/conf.d/00_curl.ini
    - /etc/php8/conf.d/00_iconv.ini
    - /etc/php8/conf.d/00_mbstring.ini
    - /etc/php8/conf.d/00_openssl.ini
    - /etc/php8/conf.d/00_zip.ini
    - /etc/php8/conf.d/01_phar.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-gd --ignore-platform-req=ext-dom` to temporarily ignore these required extensions.