1

Good afternoon,

I had a time with a problem running composer update in my production repository. Only in production, in DEV and PRE does not happen to me, everyone has the same configuration and at the end pull almost the same repository and share composer.json

I'm using "laravel / framework": "5.2. *", With PHP 7.0

The problem I have is that when launching composer update, I generate this file, bootstrap / cache / compiled.php but only in PROD, in neither of the other versions generates it, nor in local. With this file loaded the application gives an error 500 and reports this failure:

PHP Fatal error: Can not declare class Illuminate \ Support \ ServiceProvider, because the name is already in use in /var/www/vhosts/proyecto/bootstrap/cache/compiled.php on line 5267

If I delete this file by hand the application works again, but this should not happen, in addition, the applications that I try to install with composer, since I have this bug, do not work, I declare them in config / app.php and check that this The folder in vendor and everything is correct, but it gives another 500 so the reason why it does not erase or generate bootstrap / cache / compiled.php makes the installations do not end up being correct.

Please, could you help me, I do not know what else to look or do ....

This is my composer file:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
    "php": ">=5.5.9",
    "laravel/framework": "5.2.*",
    "twbs/bootstrap": "^3.3",
    "laravelcollective/html": "5.2.*",
    "joshcam/mysqli-database-class": "dev-master",
    "opentok/opentok": "2.3.x",
    "intervention/image": "^2.3",
    "hisorange/browser-detect": "2.*",
    "ignited/laravel-omnipay": "2.*",
    "omnipay/omnipay": "*",
    "skecskes/calendar": "0.2.*",
    "webpatser/laravel-uuid": "^2.0",
    "barryvdh/laravel-debugbar": "^2.2",
    "maatwebsite/excel": "~2.1.0",  
    "paypal/rest-api-sdk-php": "*",
    "laracasts/flash": "^2.0",
    "doctrine/dbal": "^2.5",
    "laravel/cashier": "~6.0",
    "barryvdh/laravel-dompdf": "0.7.*",
    "dompdf/dompdf": "^0.7",
    "ovh/ovh": "^2.0",
    "docusign/esign-client": "^2.0",
    "sentry/sentry": "^1.6",
    "sentry/sentry-laravel": "^0.7.0"
},
"require-dev": {
    "fzaninotto/faker": "~1.4",
    "mockery/mockery": "0.9.*",
    "phpunit/phpunit": "~4.0",
    "symfony/css-selector": "2.8.*|3.0.*",
    "symfony/dom-crawler": "2.8.*|3.0.*"

},
"autoload": {
    "classmap": [
          "database"
        ],
        "psr-4": {
          "App\\": "app/"
        }
},
"autoload-dev": {
    "classmap": [
        "tests/TestCase.php"
    ]
},
"scripts": {
    "post-root-package-install": [
        "php -r \"copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "php artisan key:generate"
    ],
    "post-install-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postInstall",
        "php artisan optimize"
    ],
    "post-update-cmd": [
        "Illuminate\\Foundation\\ComposerScripts::postUpdate",
        "php artisan optimize"
    ]
},
"config": {
    "preferred-install": "dist"
}

Thank you very much, greetings

1 Answer 1

4

Update 2017/06/15 08:00 CEST

Remove, one by one the third party package from the require/requir_dev section and retry composer update


Mostly, third party packages cause this error. You can do the following things:

  • Run php artisan clear-compiled and retry composer update
  • Remove the generated service provider from compiled.php and retry composer update
  • Make a fresh installation
  • You're using PHP 7.0. It's not forbidden (I recommend) to use a newer version of Laravel!
Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I am using L52 in this version, after the summer updated to L55 LTS. I tried to do that you said, but dosen't work. Deleted all service provider from compiled.php but allways fail the same line 5267 but this line after delete provider it is a empty line... do you have any idea?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.