9

I have successfully followed the Setup a Mac Dev Machine until this tutorial: https://laracasts.com/series/setup-a-mac-dev-machine-from-scratch/episodes/10?autoplay=true

The problem is that when I go to SITENAME.dev, nothing shows up. Instead, I get the following message:

This site can’t be reached

test2.dev refused to connect. Did you mean http://test2.de/? Search Google for test2 dev ERR_CONNECTION_REFUSED

I've tried this both for a laravel install (using the laravel installer) and a wordpress install. Neither one works.

Any idea why it is not working. I have followed the course step-by-step as well as the comments. For instance, I modified the .zshrc file as follows based on the course and comments:

export PATH=$HOME/bin:/usr/local/bin:$HOME/.composer/vendor/bin:$PATH

And, in case it is relevant, I am on Mac Sierra (freshly updated).

In short, where Jeffrey is able to get a home page of laravel, I get an error.

Any idea how to fix this?

Thanks.

Moshe
  • 551
  • 3
  • 7
  • 17
  • Make sure you're going to `http://yoursite.test` instead of `https://yoursite.test` that got me. Assuming you haven't done the valet secure set up (https://laravel.com/docs/9.x/valet#securing-sites) – Connor Leech Oct 28 '22 at 20:17

7 Answers7

32

Go to your site folder and execute the following commands:

cd your_project
composer global update
valet uninstall
rm -rf ~/.valet
rm -rf ~/.config/valet
valet install
valet link
valet open

It fixed this issue for me, and particularly after PHP upgrades.

DevonDahon
  • 7,460
  • 6
  • 69
  • 114
3

Solution:

composer global update
brew upgrade nginx
cd your_project
valet start

For more details read this blog https://medium.com/@panjeh/valet-this-site-cant-be-reached-err-connection-refused-ad424ea1e343

panjeh
  • 1,310
  • 1
  • 14
  • 11
2

Mac os mojave - version 10.14, cd in your-project-folder-name and run valet secure your-project-folder-name

Shimax s
  • 51
  • 4
  • 1
    My .htaccess was forcing the https urls. So default http url was not working. Running `valet secure folder-name` helped – Raghavendra N Feb 06 '19 at 08:07
0

Have you actually started the valet service? Head over to the directory that you ran

$valet park

in, I'm assuming it's where you've also placed your project and type:

$valet start

into the terminal. That works for me.

Marc Hampson
  • 257
  • 1
  • 4
  • 17
  • Is your laravel project definitely called 'test2' and in the directory that you've set parked valet? Another thing to check is that your install is using the .dev extension $valet domain – Marc Hampson Aug 11 '17 at 15:55
  • Yes, the project is definitely called test2 (I've done different tests with different names). I am sure that I've parked my Sites directory (where test2 is located). And I just ran valet domain and it came back dev (so it is using the .dev extension). – Moshe Aug 11 '17 at 16:27
  • Have you searched the Laracasts forum for answers too? Sounds like you’re doing everything right, but someone else may have had a similar issue – Marc Hampson Aug 11 '17 at 16:43
  • I posted on both the laracasts forum as well as the laravel/valet github issues forum. I haven't heard from them yet. I'm wondering if the problem is with Sierra. Either way - thanks for your help :). – Moshe Aug 11 '17 at 17:07
  • I’m also on Sierra. Good Luck! – Marc Hampson Aug 11 '17 at 17:10
0

Be sure you're over http://app.test and not https://app.test

Laravel Valet uses Not secure http as default.

By the way if you want to secure your app then use

valet secure YOURAPPNAME
0

Deleting the file (sudo rm /etc/resolver/dev) will clear this issue up.

0

IF valet is trying to open a HTTPS (SSL connection) type command line in your terminal

valet secure
David Raleche
  • 436
  • 5
  • 11