如何在本地主机的端口80上运行laravel 5? [英] How to run laravel 5 on port 80 of localhost?
问题描述
对于早期版本的Laravel,您只需在apache服务器的根文件夹中下载带有composer的laravel,然后输入http://localhost/public/
即可看到您已经到来"的主页.
For previous versions of Laravel, you can simply download laravel with composer in the root folder of your apache server and type in http://localhost/public/
to see the "You've arrived" homepage.
我知道我可以使用php artisan serve
来查看Laravel5默认主页,但是它在localhost:8000
上运行,并且我听说由于连接的限制和错误的原因,不应在生产中使用php artisan serve
命令表现.有没有不用php artisan serve
命令就可以查看默认主页的方法?
I know I can use php artisan serve
to view the Laravel5 default home page, but it is run on localhost:8000
and I heard that php artisan serve
command should not be used in production due to the limit of connection and the bad performance. Is there a way I can see the default home page without using the php artisan serve
command?
Laravel的安装文档中没有包含如此简单的内容,这真让人感到沮丧.
And it is really frustrating that Laravel is not including such simple thing in their installation documentation....
推荐答案
要在其他端口上运行该服务,您需要在cmd上使用以下代码将port parameter
与port number
传递:
To run the service on another port you need to pass the port parameter
with port number
using this code on the cmd:
php artisan serve --port=80
要在端口80
上运行,您可能需要管理员权限.
To run on port 80
, you might need administrator permission.
这篇关于如何在本地主机的端口80上运行laravel 5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!