情景:
服務器端執行
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服務器有時會獲得不了數據,換自帶服務器就好了。