Does Valet and Vagrant work at same time on iMac

ansible

#1

I have setup Valet for my laravel development. Now I wanted to give trellis a try for my wordpress site. I have gone though installation instructions. It goes really smooth and vagrant up command goes very well but when I try to open development url in my browser i.e. example.dev it does not open it and timed out the connection ERR_CONNECTION_TIMED_OUT

What I am doing wrong and how to fix it.


#2

I can’t recall the specifics but I remember running into problems after having installed Valet and, per the instructions, MySQL via brew. After I had gotten Valet working properly my Vagrant box was no longer working correctly.

If I remember correctly the problem was a port conflict. Larvel and Vagrant were both trying to use 3306 I think.

I do know for sure that what I ended up doing was stopping and removing the MySQL I’d added via brew. I just moved on from Valet.

I was kind of bummed because it seemed really handy.

Keep in mind, this was over a year ago, I’m old and my memory is getting worse, so YMMV.

:slight_smile:


#3

The two services can coexist but they have to be configured to use different ports if you want them to run at the same time! both services will boot up and webserver and a database server which will use port 80 and 3306 by default. So unless you configure them differently, they’ll clash against one another. Like @smutek highlighted, you’ll have to configure your services to use different ports to avoid this scenario. I believe it’s easier to change the configurations in a vagrant box more than in valet but I haven’t use vagrant in ages so I might be wrong here :slight_smile:


#4

How to configure services to use different ports to avoid this?


#5

Unfortunately I don’t think it’s possible to change the port in valet, so the only option is to change the configuration in trellis, which unfortunately I have never used so can’t really help you on that. You would have to find the nginx config file within your vagrant box and change the port from 80 to 8080 or whichever you prefer and restart your services, that should be it! Same goes for the db daemon of course!


#6

I tried to do this but could not figure out. I am new to this stuff so any help for very basic level will be appreciated.


#7

https://discourse.roots.io/search?q=ERR_CONNECTION_TIMED_OUT


#8

Do you think you might have the dev site “parked” at the same development URL in Valet as you are using with the vagrant box? Maybe some conflict there. Check /etc/hosts perhaps. To answer the original question, I use Valet and Vagrant often together.