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

Docker Local Dev Env for PhalconPHP

Hi everyone,

I'd like to create a local environment for developing in PhalconPHP using Docker.

To make everything easier and faster, I used PHPDocker.io to generate the basic Docker box, but unfortunately I'm not succeeding in installing PhalconPHP.

I'm writing here just because I think many people can be interested in it and also, it can be quite beneficial for the PhalconPHP community.

Anyone have any suggestion/idea on how to install PhalconPHP? The container is in Debian Jessie with PHP 7.0

Thanks in advance



12.2k
Accepted
answer
edited Feb '16

Hi,

If I'm not mistaken Phalcon does not support php7 yet.

FROM phpdockerio/php7-fpm:latest
# Install selected extensions
RUN apt-get update \
    && apt-get -y --no-install-recommends install  php7.0-memcached php7.0-mysql php7.0-xdebug \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR "/var/www/asdasdasd"

docker/Dockerfile.nginx.conf in this file you can change PHP to another release and also add php5-phalcon in installation line after you do next

sudo apt-add-repository ppa:phalcon/stable
sudo apt-get update
sudo apt-get install php5-phalcon

So I think the final configuration have to be something like this

FROM phpdockerio/php5-fpm:latest
# Install selected extensions

RUN apt-add-repository ppa:phalcon/stable -y \ 
    && apt-get update \
    && apt-get -y --no-install-recommends install  php5-memcached php5-mysql php5-xdebug php5-phalcon \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

WORKDIR "/var/www/asdasdasd"

Well you can compile phalcon yourself with php 7 support using:

zephir build --backend ZendEngine3

with newest zephir and phalcon branch 2.1.x



12.2k

Well you can compile phalcon yourself with php 7 support using:

zephir build --backend ZendEngine3

with newest zephir and phalcon branch 2.1.x

Than, you have to update Docker file with the steps you usually do when compile phalcon from the source.

Like,

RUN git pull zephir \
cd ./zephir \
./bin/zephir compile \
cd ../ \
git pull phalcon  \
cd ./phalcon \
git checkout  v2.1.x \
zephir build --backend ZendEngine3

Or similar to this instruction



2.1k

Thanks so much @valVk and @Jurigag!

I'll just try both :)