Upgrading Laravel 5.5 to 5.6 error

前端 未结 12 1872
梦如初夏
梦如初夏 2020-12-08 09:38

I am trying to upgrade my Laravel 5.5 to 5.6. I have followed the instructions from the laravel website, yet I got this error:

Your         


        
相关标签:
12条回答
  • 2020-12-08 10:03

    To anyone who tried upgrading directly from laravel 5.5 to 5.7, and got this problem too, remove the trustedproxy.php file from app->config->trustedproxy.php. Hopes that helps someone.

    0 讨论(0)
  • 2020-12-08 10:05

    I did the following things and got my project to run on Laravel 5.6-dev:

    • Followed what patricus suggested
    • Changed fideloper/proxy to "~4.0", and added "minimum-stability": "dev", "prefer-stable": true at the end of my composer.json file.
    0 讨论(0)
  • 2020-12-08 10:07

    First install Laravel 5.6 i faced this error as well. Just follow the few steps below will fix it:

    • Make sure your file composer.json requirement has:
        "require": {
            "php": "^7.1.3",
            "fideloper/proxy": "^4.0",
                },
    
    • Then try composer update to make sure your composer is up-to-date
    • Finally run: composer require fideloper/proxy:~4.0
    • Done!
    0 讨论(0)
  • 2020-12-08 10:07

    Had the same issue in Laravel 5.7. You may add TELESCOPE_ENABLED=false in your .env or .env.dusk.local :Source

    0 讨论(0)
  • 2020-12-08 10:10

    Your problem comes from your use of the library TrustedProxy.

    It uses Symfony's HEADER_CLIENT_IP constant which was deprecated with Symfony 3.3 and completely removed in Symfony 4.0.

    Since Laravel 5.6 has updated to use Symfony 4 components, this will no longer work.

    The way to solve it is to do what patricus suggested and use Laravel's TrustProxies middleware.

    0 讨论(0)
  • 2020-12-08 10:11

    Faced the same issue and got a number of guidelines to resolve this. Unfortunately none of those worked or me. Actually there is no additional step or tasks needed to be addressed to fix this issue.

    Just follow the official upgrade guide from https://laravel.com/docs/5.6/upgrade and along with that remove the trustedproxy config file located at config/trustedproxy.php

    0 讨论(0)
提交回复
热议问题