We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Help: phalcon installation problem on my docker / laradock

Hi, I'm trying to install phalcon thru my custom laradock php-fpm dockerfile, but it is not working as expected.

In the docker file I have this line:

ARG PHALCONPHP=false
RUN if [ ${PHALCONPHP} = true ]; then \
    # Install the phalcon-php extension
    curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | bash && \
    apt-get install -y php7.0-phalcon \
;fi

When running that line, the error it shows:

Step 31/38 : RUN if [ ${PHALCONPHP} = true ]; then     curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | bash &&     apt-get install -y php7.0-phalcon ;fi
 ---> Running in 55b92ec5e780
Detected operating system as debian/8.
Checking for curl...
Detected curl...
Running apt-get update... done.
Installing debian-archive-keyring which is needed for installing
apt-transport-https on many Debian systems.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/phalcon_stable.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 php7.0-phalcon : Depends: phpapi-20151012 but it is not installable
E: Unable to correct problems, you have held broken packages.
ERROR: Service 'php-fpm' failed to build: The command '/bin/sh -c if [ ${PHALCONPHP} = true ]; then     curl -s "https://packagecloud.io/install/repositories/phalcon/stable/script.deb.sh" | bash &&     apt-get install -y php7.0-phalcon ;fi' returned a non-zero code: 100

I searched, googled, but couldn't find any good answers. Would need your help.

It appears that your container has the wrong version of PHP for Phalcon.

If you are using this laradok file https://hub.docker.com/r/laradock/php-fpm/~/dockerfile/ then you have php 5.6. From the messages you are pulling phalcon for php7

Check this: https://packagecloud.io/phalcon/stable and modify your commands specifically this one apt-get install -y php7.0-phalcon or you can switch your container to one that uses php7

Thanks for the reply.

Well I'm using php 7.0. Using laradock/php-fpm:7.0--1.3. And I still get that error message above. I uploaded my custom Dockerfile-70 for php-fpm in gist, used to build my php container. In my docker-compose.yml I targeted this file.

I'm using the multiple project approach of laradock, where you can define multiple application. I want it this way for simplicity reason, else I would've used other docker images that are available. Most of them all used same commands, so I'm wondering it is not working here.