# How can i run two versions of php in php-fpm?

## d-fens

Hi,

i have to move some legacy software to php7 - 

is there a way to have php5.6 and php7 in parallel on the same server using php-fpm and set the php handler per virtualhost? 

This would allow to easy switch between versons and test stuff, php-fpm and mod-fcgi is working but i have no idea how to run both at the same time  :Question: 

----------

## steven.kalemkiewicz

I just ran into a similar problem as you had. I wrote up the approach in a Stack Exchange post.

-Steve

----------

## Ant P.

Nothing to add here except to say those are some very well-written instructions. I've added a link to it on the wiki.

----------

## d-fens

just for a comparison: https://forums.gentoo.org/viewtopic-p-8075200.html#8075200

whats the advantage of ports over sockets here and using `SetHandler "proxy:fcgi://127.0.0.1:9972" # <-- Note port num.` over `FastCgiExternalServer /usr/lib/php5.6/bin/php-fpm -socket /var/run/php-fpm/php56.sock ` ?

----------

