5.5 upgrad 5.8

http://laravel.com/

http://kejyun.github.io/Laravel-4-Docum ... roduction/
回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

5.5 upgrad 5.8

文章 yehlu »

yehlu@x1c-yehlu:~/Sites/maapi$ php artisan

In trustedproxy.php line 66:

Undefined class constant 'HEADER_CLIENT_IP'

https://stackoverflow.com/questions/485 ... -5-6-error

代碼: 選擇全部


I did this and it works perfectly.

1. composer.json:

From:

"require": {
        "php": ">=7.0.0",
        "fideloper/proxy": "~3.3",
        "laravel/framework": "5.5.*",
        "laravel/tinker": "~1.0"
    },
To:

"require": {
        "php": ">=7.1.3",
        "fideloper/proxy": "~4.0",
        "laravel/framework": "5.6.*",
        "laravel/tinker": "~1.0"
    },
2. Replace app\Http\Middleware\TrustedProxies.php file with contents below:

<?php

namespace App\Http\Middleware;

use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;

class TrustProxies extends Middleware
{
    /**
     * The trusted proxies for this application.
     *
     * @var array
     */
    protected $proxies;

    /**
     * The headers that should be used to detect proxies.
     *
     * @var string
     */
    protected $headers = Request::HEADER_X_FORWARDED_ALL;
}
3. composer update
回覆文章

回到「laravel」