我安装CakePHP。假设我想在端口8080上运行CakePHP,而不是端口8765.我该怎么做?
我尝试使用bin/cake server 8080
,但没有成功。 编辑 - 它只是在8765上运行,没有说错误。
感谢您的帮助。
答案 0 :(得分:3)
所有命令都附带帮助:
-> bin/cake server --help
Welcome to CakePHP v3.x.x Console
---------------------------------------------------------------
App : src
Path: /var/www/example.dev/src/
DocumentRoot: /var/www/example.dev/webroot/
---------------------------------------------------------------
PHP Built-in Server for CakePHP
[WARN] Don't use this at the production environment
Usage:
cake server [-h] [-v] [-q] [-H] [-p] [-d]
Options:
--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
--host, -H ServerHost
--port, -p ListenPort
--document_root, -d DocumentRoot
该端口是一个选项。即您正在寻找的命令是:
-> bin/cake server --port=8080
Welcome to CakePHP v3.x.x Console
---------------------------------------------------------------
App : src
Path: /var/www/example.dev/src/
DocumentRoot: /var/www/example.dev/webroot
---------------------------------------------------------------
built-in server is running in http://localhost:8080/
You can exit with `CTRL-C`