Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Something to allow to apply different versions of php to different nginx server blocks

Since Php v5.6 the Upstream (Debian) packages of PHP support side-by-side install.

Install the versions you want, and then use a per-php-version apache config file you include in the vhosts you want it for:

Enable proxy_fcgi:

    a2enmod proxy_fcgi
php5.6.conf:

    AddHandler proxy:unix:/run/php/php5.6-fpm.sock|fcgi://localhost;php5.6 .php
php7.0.conf:

    AddHandler proxy:unix:/run/php/php7.0-fpm.sock|fcgi://localhost;php7.0 .php
Edit: brain-shart. You want nginx. Similar concept - point to the correct FastCGI socket in each block.

So each block would be then:

5.6:

    fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
7.0:

    fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
Etc.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: