所以我使用命令PHP artisan serve来运行服务器,我可以在http://127.0.0.1:8000/上查看我的Laravel站点,但是我想在APP_URL= 'http://projectName.test‘上运行我的网站,我该怎么做呢?我在网上看到了很多视频,这些视频都是自动旋转的。
MySQL Win11 XAMP
发布于 2022-07-31 05:27:40
可以设置虚拟主机,以便在本地主机中的自定义URL上运行项目。
此链接是定义虚拟主机的一个示例。
发布于 2022-07-31 05:45:08
用这个:
php artisan serve --host=projectName.test --port=80
这也是serve手册:
Description:
Serve the application on the PHP development server
Usage:
serve [options]
Options:
--host[=HOST] The host address to serve the application on [default: "127.0.0.1"]
--port[=PORT] The port to serve the application on
--tries[=TRIES] The max number of ports to attempt to serve from [default: 10]
--no-reload Do not reload the development server on .env file changes
-h, --help Display help for the given command. When no command is given display help for the list command
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi|--no-ansi Force (or disable --no-ansi) ANSI output
-n, --no-interaction Do not ask any interactive question
--env[=ENV] The environment the command should run under
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug发布于 2022-07-31 07:47:23
更改主机文件参数,如:
# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 projectName.test将目录更改为根项目并运行:
php artisan serve --host=projectName.test --port=80https://stackoverflow.com/questions/73180361
复制相似问题