Hello everyone!
I wrote this article for different php version per project in devilbox.
Used version: Devilbox v3.0.0-beta-0.3 (2023-01-02)
Resource: https://github.com/cytopia/devilbox/pull/942
First:
# Enable all PHP versions
cp compose/docker-compose.override.yml-php-multi.yml docker-compose.override.yml
# Start default set and php80
docker-compose up php httpd bind php74
PHP Version | Hostname | IP address |
---|---|---|
5.4 | php54 | 172.16.238.201 |
5.5 | php55 | 172.16.238.202 |
5.6 | php56 | 172.16.238.203 |
7.0 | php70 | 172.16.238.204 |
7.1 | php71 | 172.16.238.205 |
7.2 | php72 | 172.16.238.206 |
7.3 | php73 | 172.16.238.207 |
7.4 | php74 | 172.16.238.208 |
8.0 | php80 | 172.16.238.209 |
8.1 | php81 | 172.16.238.210 |
8.2 | php82 | 172.16.238.211 |
Second: Create backend.cfg file in your project directory
<your-devilbox-dir>\data\www\<your-php7.4-project-dir>\.devilbox\backend.cfg
conf:phpfpm:tcp:php74:9000
Final: restart containers.
Test
<your-devilbox-dir>\data\www\<your-php7.4-project-dir>\htdocs\index.php
<?php
phpinfo();
Visit: http://<your-php7.4-project-dir>.dvl.to/
I hope, useful for everyone!