用Laravel建服务端api

handsomeqin5年前技术883

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





相关文章

Gerapy Auto Extractor真好用

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

使用composer提示[ErrorException ]proc_get_status() has been disabled for security reasons 的解决方法

使用composer提示[ErrorException ]proc_get_status() has been disabled for security reasons 的解决方法

从错误提示信息中可以看到是因为关闭了PHP的proc_get_status()函数,那么如何解决这个问题呢?打开php.ini文件,搜索 disable_functions,找到如下类似内容:路径是&...

解决引用的图片403不显示问题

因为源做了https判断。在head文件中加入 :<meta name="referrer" content="no-referrer" />zbl...

Android平台签名证书(.keystore)生成指南

安装JRE环境(如已有可跳过)可从Oracle官方下载jre安装包:https://www.oracle.com/technetwork/java/javase/downloads/index.htm...

在这里插入图片描述
大概在这个位置给www用户权限;添加这句:www ALL=(ALL) ALL;强制保存并退出:wq!
然后切换到www用户的家目录

cd /home/www1

准备工作做完了,现在开始下载nginx源包,使用wget工具下载

wget http://nginx.org/download/nginx-1.6.3.tar.gz1

如果执行这一步的时候出现了,命令不存在之类的错误信息,可能是因为wget工具未安装,需要使用yum工具安装一下wget工具

yum -y install wget1

安装成功后在执行下载命令;
此时www的家目录中会有一个名为nginx-1.6.3.tar.gz的压缩文件
切换到www用户并解压这个文件

su - wwwtar -xvf nginx-1.6.3.tar.gz12

解压之后会有一个名为nginx-1.6.3的目录文件;
我们更改一下nginx-1.6.3及其子文件的属主和属组

chown -R www:www nginx-1.6.31

更改成功之后进入这个文件

cd nginx-1.6.31

执行配置命令

./configure1

接下来编译文件,编译成功后,可以看到一个Makefile文件

make1

一般在这里会出现问题,下面给出问题截图和解决方法
1、
在这里插入图片描述
问题原因:不知道
解决方法:进入到nginx-1.6.3目录下(解压的目录)
找到当前目录下找到objs文件夹,并进入,打开文件Makefile,

vim objs/Makefile1

找到有一下内容的这行:(就在前几行)

CFLAGS =  -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g 1

-Werror: gcc将所有的警告当成错误进行处理把这行内容中的 “-Werror”去掉
2、在这里插入图片描述
错误原因:不知道
解决方法:编辑这个文件

vim /home/www/nginx-1.6.3/src/os/unix/ngx_user.c1

把这一行注释掉(35行左右)
Centos8下安装nginx

Centos8下安装nginx

在最近的实训实验中需要在centos8下安装nginx,在安装过程中遇到了很多问题,在此对我的安装过程做一个分享;准备工作Vmware(安装了centos8),虚拟机可以上网开始安装安装依赖包,使用y...

linux服务器修改ssh默认22端口方法

linux服务器修改ssh默认22端口方法

今天ssh登录时偶然发现root密码登录后提示:Last failed login: Fri Dec 15 10:41:37 CST 2017 from 51.15.220.221 on ssh:no...