Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

ChristophAust's avatar

Upgrading Laravel installation

HI there,

I am trying to update my Laravel project from 5.5 to 5.6.

So in composer.json file I did:

"laravel/framework": "5.6.*",
[...]
"fideloper/proxy": "^4.0"

But I get the following output:

Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 11 updates, 2 removals
  - Removing symfony/polyfill-php70 (v1.12.0)
  - Removing mtdowling/cron-expression (v1.2.1)
  - Installing symfony/mime (v4.3.6): Loading from cache
  - Updating symfony/http-foundation (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/debug (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/var-dumper (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/routing (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/process (v3.4.33 => v4.3.6): Loading from cache
  - Installing symfony/polyfill-php73 (v1.12.0): Loading from cache
  - Updating symfony/http-kernel (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/finder (v3.4.33 => v4.3.6): Loading from cache
  - Installing symfony/service-contracts (v1.1.7): Loading from cache
  - Updating symfony/console (v3.4.33 => v4.3.6): Loading from cache
  - Downgrading nesbot/carbon (1.39.1 => 1.25.3): Loading from cache
  - Installing dragonmantank/cron-expression (v2.3.0): Loading from cache
  - Updating laravel/framework (v5.5.48 => v5.6.39): Loading from cache
  - Updating fideloper/proxy (3.3.4 => 4.2.1): Loading from cache
symfony/service-contracts suggests installing symfony/service-implementation
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 255

I do not have any entries in error logs. Version 5.5 works fine. Any ideas, where to start digging?

0 likes
42 replies
jlrdw's avatar

I usually make sure laravel is updated before I update the framework, including the current composer file.

https://laravel.com/docs/5.6/upgrade

Note that having the correct composer file before updating the framework is important.

Laravel = app stuff

Framework = vendor stuff

ChristophAust's avatar

This is exactly what I am trying to do and I was already following your link:

Update your laravel/framework dependency to 5.6. and your fideloper/proxy dependency to ^4.0 in your *composer.json file.

jlrdw's avatar

Once laravel is updated, to include the correct composer file, try deleting the vendor folder and running composer clearcache, then composer install.

Laravel has got to be updated first.

Then the framework.

Edit: get the correct laravel from the release page.

https://github.com/laravel/laravel/releases

It will have the correct composer. Json file.

ChristophAust's avatar

If I get you right, you want me to replace my composer.json file with a plain one from a version 5.6 and delete my vendor folder, right?

And after updating laravel pull one by one the dependencies in.

Am I correct?

jlrdw's avatar

No add your dependencies in the correct composer file just before running install.

How many extra dependencies do you have that's not part of a normal install.

I usually place all extra dependencies together.

ChristophAust's avatar

I added the mentioned dependencies to the composer.json file in my projects root. Afterwards I run composer update. This is also how I upgrade from 5.0 to 5.5.

ChristophAust's avatar

So this is my composer.json from projects root:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.6.4",
        "laravel/framework": "5.5.*",
        "intervention/image": "^2.3",
        "predis/predis": "^1.1",
        "sammyk/laravel-facebook-sdk": "^3.0",
        "dawson/youtube": "^2.0",
        "doctrine/dbal": "^2.5",
        "stil/gd-text": "^1.1",
        "guzzlehttp/guzzle": "^6.3",
        "laravel-notification-channels/onesignal": "^1.2.0",
        "berkayk/onesignal-laravel": "^0.9.9",
        "rap2hpoutre/laravel-log-viewer": "^0.22.1",
        "tymon/jwt-auth": "^0.5.12",
        "laravel/tinker": "^1.0",
        "league/flysystem-aws-s3-v3": "^1.0",
        "aws/aws-sdk-php-laravel": "^3.3",
        "fideloper/proxy": "~3.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~6.0",
        "symfony/css-selector": "3.1.*",
        "symfony/dom-crawler": "3.1.*" ,
        "filp/whoops": "~2.0"
       },
    "autoload": {
        "files": ["app/Http/helpers.php"],
        "classmap": [
            "database"        ],
        "psr-4": {
            "App\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"file_exists('.env') || 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"
        ],
        "post-autoload-dump": [
            "Illuminate\Foundation\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover"
        ]        
    },
    "config": {
        "preferred-install": "dist"
    }
}
jlrdw's avatar

Did it work. And "fideloper/proxy": "^4.0", is on composer already.

ChristophAust's avatar

No it did not work. This is what I first tried and came here with this error.

On this json file I tried to change

"laravel/framework": "5.6.*",
[...]
"fideloper/proxy": "^4.0"

But I got this error 255

jlrdw's avatar

You don't have to change that stuff in your composer file it's there already, like I said have the correct composer file to start with.

You only need to add in any extra dependencies or packages you have.

I've never had any upgrade problems if I update laravel first.

ChristophAust's avatar

I dont understand what you mean?

Update your laravel/framework dependency to 5.6. and your fideloper/proxy dependency to ^4.0 in your *composer.json file.

This is what the documentation sais. You want me to not touch this file? Where do I get the correct composer file then?

Snapey's avatar

run php artisan package:discover and see what error it gives

ChristophAust's avatar

But in the link there is no composer file or am I missing it?

jlrdw's avatar

You scroll down find the correct file and download the zip file.

You're wanting to upgrade replace your composer file with the one from the correct version you are upgrading to.

I have upgraded many times over the last 4 years and never had such a problem.

But besides that upgrade laravel before you try to upgrade the framework.

Snapey's avatar

The upgrade all went ok until you got to that line. Perhaps try the verbose logging option?

ChristophAust's avatar

Thank you, will check them. The strange thing is, everything works fine with 5.5 though.

jlrdw's avatar

If you have any spaces in env wrap them in quotation marks should work.

ChristophAust's avatar

Somehow I clicked on "Best Answer" by accident. There were no spaces in env file and also using the composer.json file from your linked source code also did not work.

jlrdw's avatar

@christophaust are you saying you still cannot upgrade laravel. A 5.5 to a 5.6 should only be a 15 minute upgrade.

file from your linked source code also did not work.

That is not my source code, that is the official laravel repository. There is no way the correct composer file doesn't work, I myself a while back did a 5.5 to 5.6 upgrade.

Edit: Have you considered just doing a new install, and migrate your code (controllers, models, etc) over to the new install.

But honest, it is so easy to go from 5.5 to 5.6. You have to update laravel prior to doing a composer update on the framework.

ChristophAust's avatar

Exactly, I still cannot. I get the same issue. All updates before were almost no-brainers. The upgrade guides really were on point for me. But now updating to 5.6 is really breaking everything for me. ´

ChristophAust's avatar

This is the output:

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 22 updates, 3 removals
  - Removing symfony/polyfill-php70 (v1.12.0)
  - Removing mtdowling/cron-expression (v1.2.1)
  - Removing phpunit/phpunit-mock-objects (5.0.10)
  - Installing symfony/mime (v4.3.6): Loading from cache
  - Updating symfony/http-foundation (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/debug (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/var-dumper (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/routing (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/process (v3.4.33 => v4.3.6): Loading from cache
  - Installing symfony/polyfill-php73 (v1.12.0): Loading from cache
  - Updating symfony/http-kernel (v3.4.33 => v4.3.6): Loading from cache
  - Updating symfony/finder (v3.4.33 => v4.3.6): Loading from cache
  - Installing symfony/service-contracts (v1.1.7): Loading from cache
  - Updating symfony/console (v3.4.33 => v4.3.6): Loading from cache
  - Downgrading nesbot/carbon (1.39.1 => 1.25.3): Loading from cache
  - Installing dragonmantank/cron-expression (v2.3.0): Loading from cache
  - Updating laravel/framework (v5.5.48 => v5.6.39): Loading from cache
  - Updating fideloper/proxy (3.3.4 => 4.2.1): Loading from cache
  - Updating sebastian/resource-operations (1.0.0 => 2.0.1): Loading from cache
  - Updating sebastian/environment (3.1.0 => 4.2.2): Loading from cache
  - Updating sebastian/diff (2.0.1 => 3.0.2): Loading from cache
  - Updating sebastian/comparator (2.1.3 => 3.0.2): Loading from cache
  - Updating phpunit/php-timer (1.0.9 => 2.1.2): Loading from cache
  - Updating phpunit/php-file-iterator (1.4.5 => 2.0.2): Loading from cache
  - Updating phpunit/php-token-stream (2.0.2 => 3.1.1): Loading from cache
  - Updating phpunit/php-code-coverage (5.3.2 => 6.1.4): Loading from cache
  - Updating phar-io/version (1.0.1 => 2.0.1): Loading from cache
  - Updating phar-io/manifest (1.0.1 => 1.0.3): Loading from cache
  - Updating phpunit/phpunit (6.5.14 => 7.5.17): Loading from cache
symfony/service-contracts suggests installing symfony/service-implementation
Writing lock file
Generating autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
https://carbon.nesbot.com/docs/#api-carbon-2
    You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
Next

Please or to participate in this conversation.