Composer throws PHP Fatal error: Interface 'Monolog\ResettableInterface' not found when deploying
Composer throws PHP Fatal error: Interface 'Monolog\ResettableInterface' not found when deploying
这是我的 composer.json 文件:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"laravel/framework": "5.1.*",
"illuminate/support": "5.1.*",
"laravelcollective/html": "^5.1.9",
"twilio/sdk": "^5.4.2",
"monolog/monolog": "1.11.*",
"maatwebsite/excel": "^2.1.8",
"fideloper/proxy": "^3.3.4",
"sentry/sentry": "^1.0",
"barryvdh/laravel-dompdf": "^0.7",
"dompdf/dompdf": "0.7.0 as 0.6.2",
"phenx/php-font-lib": "0.4 as 0.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
我有一个运行良好的本地版本,但是当我尝试部署到我们的服务器时,我得到
PHP Fatal error: Interface 'Monolog\ResettableInterface' not found in /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php on line 28 Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255
我到处都看过,我发现的唯一修复方法是手动下载并添加 ResettableInterface.php 并将其放在 monolog vendor 目录中,但我不能这样做,因为它已安装然后自动测试通过部署程序脚本,如果它失败,它将不会部署,所以我没有机会这样做。我该怎么办?
尝试删除或重命名供应商文件夹和 Composer.lock 文件。现在 运行 作曲家安装。这将创建具有所有新依赖项的供应商文件夹。
这是我的 composer.json 文件:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"laravel/framework": "5.1.*",
"illuminate/support": "5.1.*",
"laravelcollective/html": "^5.1.9",
"twilio/sdk": "^5.4.2",
"monolog/monolog": "1.11.*",
"maatwebsite/excel": "^2.1.8",
"fideloper/proxy": "^3.3.4",
"sentry/sentry": "^1.0",
"barryvdh/laravel-dompdf": "^0.7",
"dompdf/dompdf": "0.7.0 as 0.6.2",
"phenx/php-font-lib": "0.4 as 0.2.2"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"phpunit/phpunit": "~4.0",
"phpspec/phpspec": "~2.1"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan optimize"
],
"pre-update-cmd": [
"php artisan clear-compiled"
],
"post-update-cmd": [
"php artisan optimize"
],
"post-root-package-install": [
"php -r \"copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
}
}
我有一个运行良好的本地版本,但是当我尝试部署到我们的服务器时,我得到
PHP Fatal error: Interface 'Monolog\ResettableInterface' not found in /var/www/html/vendor/monolog/monolog/src/Monolog/Logger.php on line 28 Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255
我到处都看过,我发现的唯一修复方法是手动下载并添加 ResettableInterface.php 并将其放在 monolog vendor 目录中,但我不能这样做,因为它已安装然后自动测试通过部署程序脚本,如果它失败,它将不会部署,所以我没有机会这样做。我该怎么办?
尝试删除或重命名供应商文件夹和 Composer.lock 文件。现在 运行 作曲家安装。这将创建具有所有新依赖项的供应商文件夹。