安装composer
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --version=1.6.5
mv composer.phar /usr/local/bin/composer
composer -v
composer global config bin-dir --absolute
PATH=$PATH:/root/.composer/vendor/bin
PATH=$PATH:$HOME/.config/composer/vendor/bin
PATH=$PATH:$HOME/.composer/vendor/bin
echo $PATH
cd /home/wwwroot/
composer global require laravel/installer
------------------------------------------------------------------------------------------------
出现需要翻墙情况
提示:The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection refused
以上所有问题的原因都是镜像的问题,国外镜像加载速度慢,那么换个镜像,下面加载阿里云的镜像,执行:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
------------------------------------------------------------------------------------------------
composer create-project laravel/laravel=5.7.* laravel --prefer-dist
cd /home/wwwroot/laravel
执行composer update
安装laravel参考:https://blog.csdn.net/weixin_42433970/article/details/102948100
------------------------------------------------------------------------------------------------
错误提示:
Problem 1
- league/flysystem 1.0.69 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.
缺扩展Fileinfo解决方法:
lnmp.conf配置文件内容看下有没有 Enable_PHP_Fileinfo='y' 这样的配置
------------------------------------------------------------------------------------------------
rewrite URL 方案:
/usr/local/nginx/conf/vhost/web.com.conf
调试错误:
index.php
ini_set("display_errors", "On");
error_reporting(E_ALL | E_STRICT);
数据库认证错误的解决方案:
https://blog.csdn.net/b1829g2590d2216/article/details/99673808
default_authentication_plugin=mysql_native_password
---------------解决by lin-----------------
laravel要删除open_basedir方法:
/usr/local/nginx/conf/fastcgi.conf
最后三行:
fastcgi_param PHP_ADMIN_VALUE "open_basedir=NULL";
# fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
# fastcgi_param PHP_ADMIN_VALUE "open_basedir=$document_root/:/tmp/:/proc/";
---------------------------------------------------