用Laravel建服务端api

handsomeqin5年前技术894

一、安装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





相关文章

关于php不解析直接下载的问题

碰到xmdtn下的index.php不解析,直接download。修改nginx.conf 不管用。ca,原来要重启nginx和php-fpm:service nginx restartservice...

仿站的时候一个元素一直刷不出来的问题

html,js,css都一样了,还有一个元素一直出不来。通过分析js源码,发现有一个参数‘id’是地址栏里带的,在js中做了处理,导致后续的数据都要根据这个id才能展示。把地址栏的地址后面加上‘’?i...

产品做好了,如何推广

加班加点干出来产品了,结果考虑怎么推广花了一个星期,关键是还没想清楚怎么来推.成本是基本上不愿意花的,只能靠免费的seo,aeo了.知乎上发个软文,秒删.发愁,怎么办呢?产品是个好产品,得找人体验啊....

JS解密入门——有道翻译

JS解密入门——有道翻译

JS解密入门——有道翻译此篇文章省略了很多基础的,例如json格式数据的提取啊。试试手,练练感觉。似乎也没啥用。一 了解加密与解密 :什么是加密,什么是解密?加密:数据加密的基本过程,将原为明文的文件...

Gerapy Auto Extractor真好用

import jsonimport requestsfrom gerapy_auto_extractor.extractors.list import extract_list# html = ope...

php中正则表达式对斜杠的处理

斜杠需要加两个反斜杠 \\ 进行转义.$key = "https://file.ipadown.com/tophub/assets/images/media/appinn.com.png&q...