【问题标题】:Laravel development server doesn't work windowsLaravel 开发服务器在 windows 下不工作
【发布时间】:2017-03-28 11:44:02
【问题描述】:

我在我的电脑上安装了 laravel,它通过 PhpStorm 运行良好,Git 命令提示符中的 laravel 命令以及 composer 和 php artisan 运行良好。 但是对于命令

php artisan serve

它给了我一个不起作用的地址

Laravel development server started: <http://127.0.0.1:8000>

如果我尝试访问该地址,它会显示“无法访问此站点”。顺便说一句,我正在使用 Chrome 为什么会这样?我怎样才能让它发挥作用?

提前谢谢你。

【问题讨论】:

  • 尝试 php artisan serve --port=8080 然后转到 localhost:8080。我也推荐使用 vagrant/homestead laravel.com/docs/5.4/homestead
  • 谢谢,成功了!我将来可能会考虑宅基地,目前我希望学习 laravel 的基础知识,我正在为此使用 xampp
  • 如果你使用 wamp,你可以在 wamp 中添加一个主机并在浏览器中使用你提供的地址访问网站:laravel.dev。这样您就可以并行运行尽可能多的网站 (john-dugan.com/wamp-vhost-setup)

标签: php git laravel serve


【解决方案1】:

我推荐你使用 Laragon 在 Windows 上开发 laravel 甚至任何 php 应用程序。它将建立一个非常易于使用和快速的开发环境。我已经使用它一年多了。在这里获取:https://laragon.org/

这个应用程序是特定于 Windows 用户的。其中一些功能包括:

Cmder
Git
Node.js
NPM
SSH
Putty
PHP 7 & 5.6 (Easily switchable with one click)
Activate/deactivate PHP extensions on the fly
xDebug
Composer
Apache
MariaDB/MySQL
phpMyAdmin
Full Lumen and Laravel support
Auto create virtual hosts
Mail Catcher - Laragon will show a small window on the bottom right of your screen and help you quickly view content of the generated email
Mail Sender - You can use mail() function to send mail to the Internet easily and effortlessly
Mail Analyzer: Analyze what happens when an email is sent and show helpful information to make sure that your email configurations are correct.
ngrok - allows connections from the Internet to the local server

这是关于 laragon 和 laravel 5.4 的教程: http://www.danfletcherblog.ca/2017/02/install-laravel-5-4-windows-fast-using-laragon-%E2%9C%94/

这是帖子的视频教程:https://youtu.be/pHQOdXY2AZU?list=PL0Nx259JjLcGqXg5kpTifqQ9GFoQ2qGPy

【讨论】:

  • 请让您的答案更清楚,并添加 laragon 的好处,以及为什么它比说宅基地、代客或只是简单的旧 wamp 更好。将来可能会对其他人有所帮助。
猜你喜欢
  • 1970-01-01
  • 2017-11-17
  • 1970-01-01
  • 1970-01-01
  • 2021-12-15
  • 2011-03-02
  • 2021-03-27
  • 2011-05-30
  • 2022-01-15
相关资源
最近更新 更多