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 !


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM