我刚刚将我的网站移到一个单独的服务器上,以确保当我将网站推送到生产服务器时,一切都顺利过渡。不幸的是,当我访问链接时,该网站显示为空白,除非我添加类似“echo'hello';”的内容在index.php页面中,laravel存储文件中没有记录任何内容(即使权限递归设置为777),我收到此错误:
nickstaging@ubuntuStaging:/var/www/html/almost_acceptable$ php artisan config:cache
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var
/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
PHP Fatal error: Uncaught ReflectionException: Class log does not exist in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php:741
Stack trace:
#0 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(741): ReflectionClass->__construct('log')
#1 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(631): Illuminate\Container\Container->build('log', Array)
#2 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(674): Illuminate\Container\Container->make('log', Array)
#3 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(842): Illuminate\Foundation\Application->make('log')
#4 /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php(805): Illuminate\Container\Container->resolveClass(Object(ReflectionParameter))
#5 /var/www/html/almost_acceptable/vendor/laravel/framework/src/I in /var/www/html/almost_acceptable/vendor/laravel/framework/src/Illuminate/Container/Container.php on line 741
对于我的生活,我不能弄清楚它为什么会发生。它记录在服务器上的apache日志文件中。该网站仍然在我运行进行一般测试的本地hometead vm上运行正常,我尝试将所有文件重新上传到服务器但没有任何工作。
如果有人知道为什么会这样,那就太棒了,我非常感激!提前谢谢!
修改 安装php-mysql并没有解决问题,之后错误没有区别。
答案 0 :(得分:1)
最常见的问题是你的.env文件中有空格,或者你的一个配置文件中有错误的值。
更多信息:
https://laracasts.com/discuss/channels/general-discussion/class-log-does-not-exist