laravel 使用composer 进项项目管理,所有使用 laravel 必须先安装 composer。 使用 laravle 创建项目有两种方法。 laravel 安装器和 composer 。
使用 laravel 安装器进行项目安装,可能要在laravel 官网上下载资源。 使用 composer 加上国内的镜像,速度更快体验更好。
# Author: www.phpjiaocheng.com
composer create-project --prefer-dist laravel/laravel blog
创建项目后就是启动项目
# Author: www.phpjiaocheng.com
./artisan serve --host=127.0.0.1 --port=8000
artisan serve 的帮助信息
# Author: www.phpjiaocheng.com
./artisan -h 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]
-h, --help Display this help message
-q, --quiet Do not output any message
-V, --version Display this application version
--ansi Force ANSI output
--no-ansi Disable 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