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

php-worker cannot be created #1486

Closed
lapswr opened this issue Apr 17, 2018 · 5 comments
Closed

php-worker cannot be created #1486

lapswr opened this issue Apr 17, 2018 · 5 comments
Labels

Comments

@lapswr
Copy link

lapswr commented Apr 17, 2018

Info:

  • Docker version (Docker version 18.03.0-ce, build 0520e24):
  • Laradock commit (0c41fce):
  • System info (PC):
  • System info disto/version: Windows 10pro version 1709

Issue:

Trying to run docker-compose -d php-worker with PHP 5.6 VERSION fails


Expected behavior:

Should have build the php-worker


Reproduce:

just run the command docker-compose -d php-worker with PHP 5.6 VERSION
after you have run docker-compose -d ngix mysql


Relevant Code:

 ---> 451355b1fb2b
Step 6/13 : RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached
 ---> Running in 2a2fb44c0234
Updating channel "pecl.php.net"
Channel "pecl.php.net" is up to date
pecl/memcached requires PHP (version >= 7.0.0), installed version is 5.6.35
pecl/memcached can optionally use PHP extension "igbinary" (version >= 2.0)
pecl/memcached can optionally use PHP extension "msgpack" (version >= 2.0)
pecl/mcrypt requires PHP (version >= 7.2.0, version <= 7.3.0, excluded versions: 7.3.0), installed version is 5.6.35
No valid packages found
install failed
ERROR: Service 'php-worker' failed to build: The command '/bin/sh -c pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached' returned a non-zero code: 1
@imzyf
Copy link

imzyf commented Apr 25, 2018

I met the same issues. my system is macOS.

@lapswr
Copy link
Author

lapswr commented May 21, 2018

For anyone interested ( @imzyf )
I've found a solution.
The error is caused because is trying to install memcached and mcrpt packages with the wrong php version.
So inside the php-worker file I've edited the Dockerfile and replaced these 2 lines

 RUN docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml
RUN pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached

with this

RUN if [ ${PHP_VERSION} = '5.6.35' ]; then \
       docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml mcrypt \
        && pecl channel-update pecl.php.net && pecl install memcached-2.2.0 && docker-php-ext-enable memcached \
;else \
	if [ ${PHP_VERSION} = '7.2.0' ]; then \
		docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml \
		&& pecl channel-update pecl.php.net && pecl install memcached mcrypt-1.0.1 && docker-php-ext-enable memcached \
	;else \
    	docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml mcrypt \
    	&& pecl channel-update pecl.php.net && pecl install memcached && docker-php-ext-enable memcached \
	;fi \
;fi

The code above looks for the php versions 5.6.35 and 7.2.0 or default case and installs the appropriate version of the memcached and mcrypt.
Notice that php 7.2.0 and above doesn't include mcrypt so thats why is installing it with pecl

@aurawindsurfing
Copy link

Worked for me! thx!

@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
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

3 participants