T
T
Tim Yusupov2016-03-11 09:47:38
PHP
Tim Yusupov, 2016-03-11 09:47:38

How to run two versions of php with Docker(or without it) + ZendGuardLoader on nginx?

One of the sites requires php from 5.3 to 5.4.3, the main version on the server is 5.6.
I dug up a lot of information, and came to the conclusion that I need to install the required version of php in Docker.
Dockerfile:

#base image name
FROM ubuntu:12.04
RUN echo  "deb http://archive.ubuntu.com/ubuntu/ precise universe" >> /etc/apt/sources.list
RUN apt-get update
#установка необходимых пакетов
RUN apt-get install -y php5 php5-fpm php5-mysql
#заставим php-fpm слушать не только localhost
RUN sed -i "s/listen = 127.0.0.1:9000/listen = 9000/g" /etc/php5/fpm/pool.d/www.conf

Create a container:
docker build -t php-fpm53 - < Dockerfile
Run in the background:
docker run -d -i -p 9010:9000 -v /var/www/:/var/www/:rw php-fpm53 /bin/sh -c "service php5-fpm start && /bin/bash"

Specify in nginx.conf:
fastcgi_pass 127.0.0.1:9010;
Everything runs fine with the version of php you need.
BUT, here it turns out that ZendGuardLoader is also needed. And then a stupor ...
How to add it to Docker? Or maybe there is some other solution, how to run parallel php 5.3 - 5.4 with ZendGuardLoader?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2016-03-11
@rforceteam

And what's the problem to shove it into the same container?
Download the zend-guard distribution, unpack and put the files next to the dockerfile . Put
the configs with the necessary edits next to it.
With the help of the "CP" command in the dockerfile, push everything in place.
Profit?
You can write a script and file everything through RUN

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question