Skip to content

no $baseURL set will be notice "The baseURL value must be set" #1476

Description

@yangyunzhi

my code

#File:App.php
public $baseURL = '';

it's will be notice

You have an empty or invalid base URL. The baseURL value must be set in Config\App.php, or through the .env file.

So, I modified the page IncomingRequest.php ,Let it automatically get $baseURL.

#File:IncomingRequest.php
#Function detectURI()
#Add Codes in 576line

// baseURL, so let's help them out.
if(empty($baseURL)){
$httpType = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';
$baseURL = $httpType . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : $_SERVER['SERVER_NAME']);
}

It's Ok , hahaha

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions