Do you know phalcon ? It’s a PHP framework, not just one between all of them, it’s the fastest ever build.

So much speed is quite simple to understand, it works as a C-extension, but you don’t have to worry, all the functions are exposed as PHP classes.

So before going further, I will make a docker image so it will be easier to manipulate.
We need to install (under debian jessie):

  • Apache 2.4
  • Php 7.0
  • Phalcon 3

The first step is to install apache and php, nothing difficult except the fact that php 7 is not in the debian repository, so I will use dotdeb. This is quick to add the repository:

Then it’s just some apt-get install with all the plugins needed as php7.0-pgsql.

The second step is to install phalcon on the image, I will use the github version. You just have to clone it, go in the directory:

Now we have to tell php that we have phalcon, here it is:

We tell it for both apache configuration and the commad line interface (CLI).
By the way, you can look I set “50-XXXX”, it’s not some magic trick, if you just put “20-XXXX” then phalcon will be load at the same moment as the others php extensions, and using the CLI you will get:

So the number has to be more than 20, the choice of 50 is arbitrary.

So now we have an image able to run a phalcon project, but if you look the documentation of phalcon there are some great commands that exists.
To be able to use them we need the phalcon-devtools that is available on git, so:

Now we get it all!

The Docker project is available on github or via the docker hub.

All the funny facts:

Debian is beautiful, but sometimes you are just not lucky:

And of course it didn’t happen during a local build, but over the docker hub one!

And it’s not the end, when the build was finally a success, I tried on my mac, no problem. Later I did the same on my debian jessie server and BOUMMMMMM … not working.
Yes the container was running, apache and php too, I was able to load a php script like phpinfo() but when it was time to try phalcon I just had a crash. I was very suprised, so I looked to find source of the problem, and it came to that line:

I knew I was just screwed.

I tried to upgrade docker from 1.11 to 1.12, but nothing changed, so I opened an issue. We can still use it with a manual build as explained in the github README.

The next part will be a basic usage of the developer tools.

Hits: 4880