C
C
centrin02015-03-09 13:19:52
PHP
centrin0, 2015-03-09 13:19:52

How to connect multiple versions of php to nginx using php-fpm?

One site requires PHP 5.2. Decided to do without Apache
Installed nginx, php-fpm on Debian Wheezy. Connected like this:

location ~ \.php$ {
                try_files $uri =404;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
}

Now you need to connect PHP 5.2 compiled by me from sources
How to tell PHP-FPM which version of PHP to use?
I read that different pools do for PHP-FPM, for example, you can set a different port. But how do you specify a different PHP assembly?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nazar Mokrinsky, 2015-03-09
@centrin0

Install Docker with the required version of PHP inside, make php-fpm listen not to a unix socket, but to http (to be honest, it is possible to configure it with unix sockets, but it will definitely be easier), bind php-fpm from the container to the host port, change unix :/var/run/php5-fpm.sock on 127.0.0.1:port.
This will make it easier and more reliable.
Everything is quite simple, read the Docker documentation, you will understand without problems.

F
FanatPHP, 2015-03-09
@FanatPHP

The author of the previous same question did not wait for an answer on a silver platter.
However, you might be lucky.

P
polozad, 2015-03-17
@polozad

Try to look at the php-fpm start script. Might get you thinking.
So, it's easy. We collect a couple of php binaries with blackjack and cookies, put them somewhere, copy and edit the php-fpm start scripts, set everything up in the configs.
Crutches-crutches.
And no dockers.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question