To test a project at same time with multiple PHP versions I have a default virtualhost with project name and version alias:
<VirtualHost _default_:80> ServerName project.localhost ServerAlias php74.project.localhost DocumentRoot /var/www/project/public <FilesMatch \.php$> SetHandler "proxy:unix:/var/run/php/php7.4-fpm.sock|fcgi://localhost" </FilesMatch> </VirtualHost>
And a second virtualhost with each other version to test:
<VirtualHost _default_:80> ServerName php80.project.localhost DocumentRoot /var/www/project/public <FilesMatch \.php$> SetHandler "proxy:unix:/var/run/php/php8.0-fpm.sock|fcgi://localhost" </FilesMatch> </VirtualHost>
You should remember to add this hosts to your /etc/hosts file:
/etc/hosts
127.0.0.1 project.localhost php74.project.localhost php80.project.localhost
Cheers!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
To test a project at same time with multiple PHP versions I have a default virtualhost with project name and version alias:
And a second virtualhost with each other version to test:
You should remember to add this hosts to your
/etc/hosts
file:Cheers!