Laravel 代客它有效
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/39708139/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Laravel valet It works
提问by Jamie
I'm trying to install Laravel valet
but I keep getting (when I visit domain.dev):
我正在尝试安装,Laravel valet
但我不断收到(当我访问 domain.dev 时):
It works!
I already tried a lot. For example:
我已经尝试了很多。例如:
remove valet
stop apache (apachectl stop)
composer global require laravel/valet
valet install
valet restart
But that does not work for me. I've also installed Laravel Homestead
in a vagrant box. Perhaps that has something to do with it? I can visit my Homestead sites.
但这对我不起作用。我也安装Laravel Homestead
在一个流浪者的盒子里。或许跟这有关系?我可以访问我的 Homestead 网站。
How can I fix this problem?
我该如何解决这个问题?
回答by mesqueeb
"It works!" will always be a message from Apache. Apache has to be turned off for Laravel Valet to work.
“有用!” 将始终是来自 Apache 的消息。必须关闭 Apache 才能让 Laravel Valet 工作。
I see you have tried these before:
我看到你以前尝试过这些:
$ stop apache (apachectl stop)
$ sudo apachectl -k stop
$ stop apache (apachectl stop)
$ sudo apachectl -k stop
I had the same problem. Try with the command below and then after be sure to restart valet again! This fixed it for me:
我有同样的问题。尝试使用下面的命令,然后确保再次重新启动代客泊车!这为我修复了它:
$ sudo apachectl stop
$ valet restart
回答by mikoop
So many different combinations of what to do here
在这里要做的事情有很多不同的组合
Here is what worked for me.
这对我有用。
Turn off other local Apache altogether
完全关闭其他本地 Apache
sudo apachectl -k stop
sudo launchctl unload -w /System/Library/LaunchDaemons/org.apache.httpd.plist
Remove the Valet directory altogether
完全删除 Valet 目录
rm -r ~/.valet
Removed Valet via composer globally
通过 Composer 在全球范围内删除了 Valet
composer global remove laravel/valet
Re-install via composer
通过 Composer 重新安装
composer global require laravel/valet
Install Valet
安装代客泊车
valet install
Go to Folder to Add directories
转到文件夹以添加目录
cd ~/Sites/
Then add projects to park
然后将项目添加到park
valet park
Change Valet domains to something else to stop urls forcing to https://
将代客域更改为其他内容以阻止 URL 强制为 https://
valet domain app
Change directory into the project folder
将目录更改为项目文件夹
cd ./laravel-project/
Then open current project
然后打开当前项目
valet open
The browser should open to http://laravel-project.app
浏览器应该打开http://laravel-project.app
回答by Paul Smalling
No need to stop Apache, and it doesn't have anything to do with Homestead.
不需要停止Apache,它和Homestead没有任何关系。
The answers provided solve your problem but they are not good.
提供的答案解决了您的问题,但效果不佳。
You can simply run
你可以简单地运行
valet port 8888
(or whatever port you want) and get your site on domain.dev:8888
(或任何您想要的端口)并在 domain.dev:8888 上获取您的站点
The point is not that Apache and Nginx don't like each other, they are agnostic of each other, just keep them listening on different ports.
重点不是 Apache 和 Nginx 不喜欢对方,它们彼此不可知,只是让它们监听不同的端口。