我新建站点之后,使用composer安装了thinkphp6,却发现报错了。网页无法打开500,那么这是为什么呢?
排查问题:
首先,我开始了百度,得出的结论是runtime目录没有权限,然后我就给了它权限,还是没有用哈!
随后我就去看了一下错误日志:
[Wed Feb 19 22:45:50.006774 2020] [php7:warn] [pid 7700] [client 127.0.0.1:44470] PHP Warning: require(/home/xuxinyuancode/DATA/2020progect/tp/public/../vendor/autoload.php): failed to open stream: No such file or directory in /home/xuxinyuancode/DATA/2020progect/tp/public/index.php on line 15
[Wed Feb 19 22:45:50.007011 2020] [php7:error] [pid 7700] [client 127.0.0.1:44470] PHP Fatal error: require(): Failed opening required '/home/xuxinyuancode/DATA/2020progect/tp/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/xuxinyuancode/DATA/2020progect/tp/public/index.php on line 15
[Wed Feb 19 22:45:50.814797 2020] [php7:warn] [pid 7701] [client 127.0.0.1:44472] PHP Warning: require(/home/xuxinyuancode/DATA/2020progect/tp/public/../vendor/autoload.php): failed to open stream: No such file or directory in /home/xuxinyuancode/DATA/2020progect/tp/public/index.php on line 15
[Wed Feb 19 22:45:50.814913 2020] [php7:error] [pid 7701] [client 127.0.0.1:44472] PHP Fatal error: require(): Failed opening required '/home/xuxinyuancode/DATA/2020progect/tp/public/../vendor/autoload.php' (include_path='.:/usr/share/php') in /home/xuxinyuancode/DATA/2020progect/tp/public/index.php on line 15
这就说明autoload没有被require进来呗,再补一下包试试:
composer install
我寻思这不是和npm一样吗?难道是没有下载完全包?那就下载一下看看:
还别说,报错了,抓一下重点哈:
Your requirements could not be resolved to an installable set of packages.
Problem 1
- topthink/framework v6.0.2 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.
问题1,说系统里面没有mbstring这个扩展,那么就安装吧,哈哈!
解决问题:
安装一下mbstring:
xuxinyuancode@XinYuan:~/DATA/2020progect/tp$ sudo apt-get install php7.3-mbstring
然后再composer install一下:
composer install
成功了!!!
完成:
嘻嘻!