lnmp 环境部署Laravel 项目操作流程

1、安装 lnmp 一键安装包:

wget http://soft.vpser.net/lnmp/lnmp1.7.tar.gz -cO lnmp1.7.tar.gz && tar zxf lnmp1.7.tar.gz && cd lnmp1.7 && ./install.sh lnmp

2、生成 ssh 密钥(非必须):

ssh-keygen -C 'xxxxxx'

3、到 github(项目托管平台)添加 ssh 公钥(非必须)

4、拉取代码(ssh 方式和 http 方式均可,使用 ssh 方式需要2、3步)

5、上传 .env 文件到项目根目录

6、修改项目目录所有者为 nginx 的用户:

chown -R 用户名:用户组 项目目录

7、修改 /usr/local/php/etc/php.ini 文件:

disable_functions 删除 proc_open 和 proc_get_status (composer 会用到这两个函数,需要取消禁用)

8、重启 lnmp:

lnmp restart

9、修改 composer 镜像源为阿里云国内镜像

全局配置:

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

当前项目配置:

composer config repo.packagist composer https://mirrors.aliyun.com/composer/

其他镜像源:

      composer        https://packagist.org
      phpcomposer     https://packagist.phpcomposer.com
  *   aliyun          https://mirrors.aliyun.com/composer
      tencent         https://mirrors.cloud.tencent.com/composer
      huawei          https://mirrors.huaweicloud.com/repository/php
      laravel-china   https://packagist.laravel-china.org
      cnpkg           https://php.cnpkg.org
      sjtug           https://packagist.mirrors.sjtug.sjtu.edu.cn

10、安装依赖包:

composer install

 11、修改 nginx 配置文件 fastcgi.conf:

#fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";//注释掉这一行

 

Enjoy it !

posted @ 2020-06-18 11:05  兴同学在上海  阅读(725)  评论(0编辑  收藏  举报