情景:
服务器端执行
php artisan migrate:rollback
报错:
[Symfony\Component\Debug\Exception\FatalThrowableError]
Fatal error: Class 'xxxxxx' not found

描述:
CreateActivitiesTable所在的migration文件存在,本地环境正常,但服务器报错。
解决:
composer dump-autoload
情景:
更新服务端的依赖包后报错:
ErrorExceptioninFilesystem.php line 109:file_put_contents(/var/www/diandot/bootstrap/cache/services.php): failed to open stream: Permission denied

解决:
php artisan cache:clear
情景:
laravel new project
报错:
cURL error 56:Recv failure:Connect reset by peer(接收网络数据失败)

解决:
大概是这个接口挂了,等一段时间就好了。
报错:
ReflectionException in compiled.php line 1381: Class does not exist
描述:
本地正常,服务器报错,找不到类,原因是在安装新依赖时,本地执行了update命令,服务器执行的是install命令,导致的错误。
服务器执行composer update即可,加入以下国内镜像:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
番外:
使用apache做laravel服务器,当发邮件的时候会导致栈溢出,换nginx就好了。
使用dingoAPI在本地nginx服务器有时会获得不了数据,换自带服务器就好了。
作者:冰淤
链接:https://www.jianshu.com/p/2e287a166d9d
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
网友评论