In production I have two servers running php7.1 and php7.3.
Other than the php-version, the environments are the same.
I’m trying to recreate this in homestead using different php-version for each site, but all sites end up using php 7.4 as it is the current version of the homestead box.
In other words, the site versioning have no effect:
Homestead.yaml
ip: "192.168.10.10"
memory: 2048
cpus: 2
provider: virtualbox
authorize: .ssh/homestead_rsa.pub
keys:
- .ssh/homestead_rsa
folders:
- map: C:/www/api
to: /home/vagrant/api
php: "7.3"
- map: C:/www/bikes
to: /home/vagrant/bikes
php: "7.1"
- map: C:/www/manager
to: /home/vagrant/manager
php: "7.3"
sites:
- map: api.test
to: /home/vagrant/api/public
- map: bikes.test
to: /home/vagrant/bikes/public
- map: manager.test
to: /home/vagrant/manager/public
databases:
- api
- bikes
- manager
Anyone got a clue what i’m doing wrong?
Is there a bettwer way to do this? Like having multiple boxes?
I’m using Vagrant 2.2.6 and Homestead 9.2.0
2
Answers
You needs to move "php:" tag to sites section. And more, you must specify "type:" tag for each site.
Fix the code and run vagrant reload –provision.
I had this issue too. Phpmyadmin required php 8.0, and I had php 8.1.
After running
sudo service --status-all | grep php
, it appeared that only one php-fpm service was up.After running
sudo service php8.0-fpm start
phpmyadmin worked fine. However after reboot service didn’t start. So I set up Homestead.yaml to start desired service.After
vagrant reload --provision
both php8.1-fpm and php8.0-fpm were up.