Welcome Guest, Not a member yet? Register   Sign In
Undefined baseURL in IncomingRequest.php
#1

(This post was last modified: 01-07-2023, 06:23 PM by dauber.)

Hey there....just upgraded from CI 3.x, followed the upgrade instructions, have my $baseUrl defined in both app/config/App.php and .env (as app.baseURL), with ending slash, but every time I try to load the site, I'm welcomed with...

"Warning: Undefined property: Config\App::$baseURL in [site]/system/HTTP/IncomingRequest.php on line 178"

and

"Fatal error: Uncaught TypeError: CodeIgniter\HTTP\IncomingRequest::detectURI(): Argument #2 ($baseURL) must be of type string, null given, called in [site]/system/HTTP/IncomingRequest.php on line 178 and defined in [site]/system/HTTP/IncomingRequest.php on line 228"

and

"TypeError: CodeIgniter\HTTP\IncomingRequest::detectURI(): Argument #2 ($baseURL) must be of type string, null given, called in [site]/system/HTTP/IncomingRequest.php on line 178 in [site]/system/HTTP/IncomingRequest.php on line 228"

Did I miss a step somewhere???

Okay, figured it out. I set up a brand new local site using nothing but the base CI4 install and it loaded. The difference: for some reason on my erroring local site the variable "$baseURL" was changed to "$baseUrl." I switched that and now I'm getting a "No direct script access allowed" screen. Not what i want, but I'll take that easily over it not recognizing my baseURL. Smile
Reply
#2

"No direct script access allowed" was the very top line on all CodeIgniter 3.x.x php files CodeIgniter 4 does
not use the line any more so remove it.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

Yeah, figured that out. Smile I thought, "Waitaminit, that constant might not be in use any more!"

So far, my experience is that the upgrade documentation should just say "Forget it, kid; just start over." )Smile
Reply




Theme © iAndrew 2016 - Forum software by © MyBB