PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, January 17, 2022

[FIXED] Composer throws PHP Fatal error: Interface 'Monolog\ResettableInterface' not found when deploying

 January 17, 2022     composer-php, laravel, monolog, php, vendor     No comments   

Issue

So here's my composer.json file:

{
"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"
}
}

I have a local version that works perfectly fine, but when I try to deploy to our server I get

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

I've looked everywhere and the only fixes I've found were to manually download and add ResettableInterface.php and place it in the monolog vendor directory but I can't do that as it's installed then tested automatically by the deployer script and if it fails it won't deploy so I don't get a chance to do this. What do I do?


Solution

Try removing or renaming the vendor folder and Composer.lock file. Now run composer install . This will create the vendor folder with all its new dependencies.



Answered By - Arun P
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing