Laravel进不去,报服务器错误。那我就查看了一下我的nginx日志,如下所示:
# /var/log/nginx/error.log
PHP Fatal error: Uncaught ReflectionException:
Class log does not exist in /var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php:736
Stack trace:
#0/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php(736): ReflectionClass->__construct('log') #1/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php(845): Illuminate\Foundation\Application->make('log')
#4/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php(800): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5/var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php(769): Illuminate\Container\Container->getDependenc in /var/www/html/Acme/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 736
这问题查询了半天,依然没解决,各种权限、重新生成文件,依然没效果,搞得我头都大了。
最后我使用composer update,更新一下项目依赖时候, 还是狂报错;于是我又使用composer install,看看是不是什么依赖包丢失了,给我了下面的提示:
Problem 1
....
the requested PHP extension mbstring is missing from your system.
....
我擦,折磨了我几天的东西终于可以找到源头了,于是,我安装了mbstring的扩展。
apt-get install php7.0-mbstring
然后,问题完美解决了!