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

Composer in combination with PHP-FPM container #1362

Closed
wvdongen opened this issue Jan 26, 2018 · 19 comments
Closed

Composer in combination with PHP-FPM container #1362

wvdongen opened this issue Jan 26, 2018 · 19 comments
Labels

Comments

@wvdongen
Copy link
Contributor

wvdongen commented Jan 26, 2018

My PHP-FPM 7 container has been configured with: PHP_FPM_INSTALL_SOAP=true

In the phpinfo() output I verified that SOAP was installed.

When I run composer install in my workspace I get the following error:

  Problem 1
    - The requested PHP extension ext-soap * is missing from your system. Install or enable PHP's soap extension.

composer.json contains:

"require": {
    "ext-soap": "*"
  },

I've done a composer self-update , this doesn't fix the problem.

Output of composer show -p doesn't list soap

root@c8da2dc5dc20:/var/www# composer show -p
Do not run Composer as root/super user! See https://getcomposer.org/root for details
composer-plugin-api 1.1.0    The Composer Plugin API
ext-bcmath          7.1.12   The bcmath PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-calendar        7.1.12   The calendar PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-ctype           7.1.12   The ctype PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-curl            7.1.12   The curl PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-date            7.1.12   The date PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-dom             20031129 The dom PHP extension
ext-exif            7.1.12   The exif PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-fileinfo        1.0.5    The fileinfo PHP extension
ext-filter          7.1.12   The filter PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-ftp             7.1.12   The ftp PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-gd              7.1.12   The gd PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-gettext         7.1.12   The gettext PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-hash            1.0      The hash PHP extension
ext-iconv           7.1.12   The iconv PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-igbinary        2.0.1    The igbinary PHP extension
ext-intl            1.1.0    The intl PHP extension
ext-json            1.5.0    The json PHP extension
ext-libxml          7.1.12   The libxml PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-mbstring        7.1.12   The mbstring PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-mcrypt          7.1.12   The mcrypt PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-memcached       3.0.4    The memcached PHP extension
ext-msgpack         2.0.2    The msgpack PHP extension
ext-mysqli          7.1.12   The mysqli PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-mysqlnd         0        The mysqlnd PHP extension (actual version: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $)
ext-openssl         7.1.12   The openssl PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pcntl           7.1.12   The pcntl PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pcre            7.1.12   The pcre PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-PDO             7.1.12   The PDO PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pdo_mysql       7.1.12   The pdo_mysql PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pdo_pgsql       7.1.12   The pdo_pgsql PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pdo_sqlite      7.1.12   The pdo_sqlite PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-pgsql           7.1.12   The pgsql PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-Phar            2.0.2    The Phar PHP extension
ext-posix           7.1.12   The posix PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-readline        7.1.12   The readline PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-Reflection      7.1.12   The Reflection PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-session         7.1.12   The session PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-shmop           7.1.12   The shmop PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-SimpleXML       7.1.12   The SimpleXML PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-sockets         7.1.12   The sockets PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-SPL             7.1.12   The SPL PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-sqlite3         7.1.12   The sqlite3 PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-sysvmsg         7.1.12   The sysvmsg PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-sysvsem         7.1.12   The sysvsem PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-sysvshm         7.1.12   The sysvshm PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-tokenizer       7.1.12   The tokenizer PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-wddx            7.1.12   The wddx PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-xml             7.1.12   The xml PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-xmlreader       7.1.12   The xmlreader PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-xmlwriter       7.1.12   The xmlwriter PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-xsl             7.1.12   The xsl PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-Zend-OPcache    7.1.12   The Zend OPcache PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
ext-zip             1.13.5   The zip PHP extension
ext-zlib            7.1.12   The zlib PHP extension (actual version: 7.1.12-3+ubuntu16.04.1+deb.sury.org+1)
lib-curl            7.47.0   The curl PHP library
lib-iconv           2.23     The iconv PHP library
lib-ICU             55.1     The intl PHP library
lib-libxml          2.9.4    The libxml PHP library
lib-openssl         1.1.0.7  OpenSSL 1.1.0g  2 Nov 2017
lib-pcre            8.41     The pcre PHP library
lib-xsl             1.1.28   The xsl PHP library
php                 7.1.12   The PHP interpreter
php-64bit           7.1.12   The PHP interpreter, 64bit
php-ipv6            7.1.12   The PHP interpreter, with IPv6 support

I’m no docker expert, but it seems Composer works with the PHP-CLI version (http://laradock.io/documentation/#change-the-php-cli-version) in the workspace and does nothing with the PHP-FPM container.

Doesn’t it make sense to add a composer install option for the PHP-FPM container? It makes no sense to install all php extensions also in your workspace container. Then you might as well use --ignore-platform-reqs using composer.

@KyawNaingTun
Copy link

Same error.....
I also has been configured like that PHP_FPM_INSTALL_SOAP=true and then rebuild php-fpm
but still has error
root@057279b2082a:~# php --ini PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-non-zts-20160303/php_soap.dll' - /usr/local/lib/php/extensions/no-debug-non-zts-20160303/php_soap.dll: cannot open shared object file: No such file or directory in Unknown on line 0

please help me

@kisglaci
Copy link

kisglaci commented Feb 5, 2018

I'm having the same problem

@newtek-bneff
Copy link

Any luck with this? I have the same issue with LDAP

@bestlong
Copy link
Member

@wvdongen workspace and php-fpm is different container. you must install SOAP both:
edit .env file set:

WORKSPACE_INSTALL_SOAP=true
PHP_FPM_INSTALL_SOAP=true

then run docker-compose build --no-cache workspace php-fpm again.

@wvdongen
Copy link
Contributor Author

@bestlong I know it is a different container (I've mentioned this in my first post). It makes no sense to install all php extensions also in your workspace container. Then you might as well use --ignore-platform-reqs using composer.

@abhaymaurya
Copy link

Hello everyone, I had same issue. I am running php via xampp and recently I tried installing a Laravel project (Windows). When running composer install I ran into this very same issue.
In my case I just had to go to:
C:\xampp\php\php.ini
as thats the config file which gets loaded for php. You can find out yours by running:
php --ini
(I use GitBash for command line operations)
So in my php.ini file I found following line:
;extension=php_soap.dll
I had to remove the ";" from the start of the line as it means commented,
Then running composer install went smooth as butter.
Hope it helps some of the fellow devs.

@bestlong
Copy link
Member

bestlong commented Mar 20, 2018

@wvdongen I misunderstood.

i remade it again, It looks like no problem

~/Sites/laradock (master *)$ git rev-parse HEAD
164069c2562bc67945b70f88ee1502b820c8698d
~/Sites/laradock (master *)$ diff .env env-example
13c13
< PHP_VERSION=71
---
> PHP_VERSION=72
63c63
< WORKSPACE_INSTALL_SOAP=true
---
> WORKSPACE_INSTALL_SOAP=false
~/Sites/laradock (master *)$ docker-compose build workspace
...
~/Sites/laradock (master *)$ docker-compose up -d workspace
~/Sites/laradock (master *)$ docker-compose exec workspace bash -c "php -m | grep soap && php -i | grep soap"
soap
/etc/php/7.1/cli/conf.d/20-soap.ini,
soap
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400
~/Sites/laradock (master *)$ docker-compose exec workspace bash -c "cd t/checksoap && cat composer.json && composer install"
{
    "require": {
       "ext-soap": "*"
    }
}

Do not run Composer as root/super user! See https://getcomposer.org/root for details
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files

@oyyarko
Copy link

oyyarko commented Apr 3, 2018

i didn't took the help of Ctrl+F and i found extensions written in notepad. And at the top of the lines i found that: ;extension=php_soap.dll.
I just removed the semicolon and it worked for me.
image

@wvdongen
Copy link
Contributor Author

wvdongen commented Apr 3, 2018

@arvinakori @abhaymaurya your comments have nothing to do with the issue that has been described! The problem is that Composer is run from the workspace container , but PHP for the app with all the extensions are running in the PHP-FPM container. So in order to use composer you would have to install all PHP extensions in both containers.

It makes no sense to install all php extensions also in your workspace container. Then you might as well use --ignore-platform-reqs using composer.

@wvdongen wvdongen changed the title PHP extension ext-soap * is missing from your system Composer in combination with PHP-FPM container Apr 3, 2018
@douglasmaiabr
Copy link

I tried several ways, but the only one that resolved provisionally was this: https://stackoverflow.com/questions/48056498/e-package-php-soap-has-no-installation-candidate-on-php7-0-fpm-docker-imag

@basepack
Copy link

Strangely when I follow @bestlong's steps, the exact same error is gone on my installation. Is this issue already fixed?

I did this:

edited .env file:

WORKSPACE_INSTALL_SOAP=true
PHP_FPM_INSTALL_SOAP=true

Then I ran: run docker-compose build --no-cache workspace php-fpm and: docker-compose up -d nginx mysql redis workspace.

The output of composer show -p lists ext-soap:

...
ext-session         7.2.6    The session PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-shmop           7.2.6    The shmop PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-SimpleXML       7.2.6    The SimpleXML PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-soap            7.2.6    The soap PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sockets         7.2.6    The sockets PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sodium          7.2.6    The sodium PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
...

@wvdongen
Copy link
Contributor Author

Strangely when I follow @bestlong's steps, the exact same error is gone on my installation

That's not strange at all, because composer runs in the workspace container and you've installed SOAP there. The whole issue in this ticket is that your application uses the PHP-FPM container, so ideally composer should check those extensions and not in the workspace.

So as previously said in #1362 (comment)

It makes no sense to install all php extensions also in your workspace container. Then you might as well use --ignore-platform-reqs using composer.

@stale
Copy link

stale bot commented Feb 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale label Feb 2, 2020
@stale
Copy link

stale bot commented Feb 23, 2020

Hi again 👋 we would like to inform you that this issue has been automatically closed 🔒 because it had not recent activity during the stale period. We really really appreciate your contributions, and looking forward for more in the future 🎈.

@stale stale bot closed this as completed Feb 23, 2020
@ledtest
Copy link

ledtest commented Sep 11, 2020

Strangely when I follow @bestlong's steps, the exact same error is gone on my installation. Is this issue already fixed?

I did this:

edited .env file:

WORKSPACE_INSTALL_SOAP=true
PHP_FPM_INSTALL_SOAP=true

Then I ran: run docker-compose build --no-cache workspace php-fpm and: docker-compose up -d nginx mysql redis workspace.

The output of composer show -p lists ext-soap:

...
ext-session         7.2.6    The session PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-shmop           7.2.6    The shmop PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-SimpleXML       7.2.6    The SimpleXML PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-soap            7.2.6    The soap PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sockets         7.2.6    The sockets PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sodium          7.2.6    The sodium PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
...

I meet this same issue too,and follow this steps solved my problem,thanks.
First,you need to run:
docker-compose --no-cache build workspace php-fpm
Then,run:
docker-compose up -d nginx mysql redis workspace
Finally,enter your workspace,eg:
docker-compose exec workspace bash
composer show -p | grep -q ext-soap
You will see soap extension installed.

@ednoreyes
Copy link

@wvdongen workspace y php-fpm es un contenedor diferente. debe instalar SOAP ambos:
editar el conjunto de archivos .env:

WORKSPACE_INSTALL_SOAP=true
PHP_FPM_INSTALL_SOAP=true

luego corre de docker-compose build --no-cache workspace php-fpmnuevo.

Detener los contenedores docker-compose stop y levantarlos de nuevo

@wvdongen
Copy link
Contributor Author

@ednoreyes Waarom praat je Spaans als iedereen Engels praat? Dit begrijp je toch ook niet?

In short please continue the discussion in English.

@entrifis
Copy link

Tried all the above and composer still didn't see the ext-gmp, because it was not installed properly in workspace. I had to add

apt-get -y update

right before the

apt-get -y install php${PHP_VERSION}-gmp

in the workspace Dockerfile, even if the apt-get is executed in the beginning of the Dockerfile.

@raphaeldcout
Copy link

Strangely when I follow @bestlong's steps, the exact same error is gone on my installation. Is this issue already fixed?

I did this:

edited .env file:

WORKSPACE_INSTALL_SOAP=true
PHP_FPM_INSTALL_SOAP=true

Then I ran: run docker-compose build --no-cache workspace php-fpm and: docker-compose up -d nginx mysql redis workspace.

The output of composer show -p lists ext-soap:

...
ext-session         7.2.6    The session PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-shmop           7.2.6    The shmop PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-SimpleXML       7.2.6    The SimpleXML PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-soap            7.2.6    The soap PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sockets         7.2.6    The sockets PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
ext-sodium          7.2.6    The sodium PHP extension (actual version: 7.2.6-1+ubuntu16.04.1+deb.sury.org+1)
...

it's works for me.
Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests