用Laravel建服务端api
一、安装composer
1、将composer.phar下载到项目中
curl -sS https://getcomposer.org/installer | php
2、把composer.phar放在系统的 PATH 目录中,就能在全局访问composer.phar。
[root@localhost data] #mv composer.phar /usr/local/bin/composer
[root@localhost data]# composer -v 查看composer版本信息
[root@my6qdvoj8skfg7]# composer -v
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 1.10.5 2020-04-10 11:44:22
Usage:
command [options] [arguments]
Options:
-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
--profile Display timing and memory usage information
--no-plugins Whether to disable plugins.
-d, --working-dir=WORKING-DIR If specified, use the given directory as working directory.
--no-cache Prevent use of the cache
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output
二、部署 laravel
配置使用使用国内镜像:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
下载 composer create-project laravel/laravel xiaohu
运行 php -S localhost:8000 -t xiaohu/public