我最近在视图中更改了2行并将代码推送到github。当我在Laravel Forge上部署(大约2周后没有更新)&我收到以下错误:
"error":{
"type":"ErrorException",
"message":"Declaration of Illuminate\\View\\Engines\\CompilerEngine::handleViewException() should be compatible with Illuminate\\View\\Engines\\PhpEngine::handleViewException($e)",
"file":"\/home\/forge\/default\/vendor\/laravel\/framework\/src\/Illuminate\/View\/Engines\/CompilerEngine.php",
"line":100
}
如果没有收到错误,我甚至无法php artisan -v
。然后我跑了composer diagnosis
并得到了:
Checking composer.json: FAIL
require.damianromanowski/simplecdn : unbound version constraints (dev-master) should be avoided
require.roumen/feed : unbound version constraints (dev-master) should be avoided
require.themonkeys/error-emailer : unbound version constraints (dev-master) should be avoided
require.abodeo/laravel-stripe : unbound version constraints (dev-master) should be avoided
require.mattbrown/laracurl : unbound version constraints (dev-master) should be avoided
require.themonkeys/cachebuster : unbound version constraints (dev-master) should be avoided
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues beyond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK
我怎么会让这个错误消失?以前从未见过,也不确定是什么问题。
答案 0 :(得分:23)
由#laravel中的AndreasLutro
提供:
尝试删除bootstrap / compiled.php。
为我修好了。
答案 1 :(得分:3)
解决此问题的正确方法是在运行php artisan clear-compiled
或composer install
之前运行composer update
如果需要,您可以在“脚本”部分的composer.json中添加以下内容,以使其自动生成:
"pre-install-cmd" :[
"php artisan clear-compiled"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],