Welcome Guest, Not a member yet? Register   Sign In
Issue with Base URL Configuration in CodeIgniter Using Laragon
#1

(This post was last modified: 10-16-2023, 05:20 PM by tarcisiodev1.)

I'm having an issue with the CodeIgniter routing system, especially when I modify the base URL, which becomes necessary when I'm using Laragon as the server with Apache since it sets up a specific URL. Here's the scenario:

Scenario without changing app.baseURL:

app.baseURL = ''

In this case, everything works correctly even if I use a different URL than the one set by Laragon, for example: http://codeigniter.test/

Scenario with a change in app.baseURL:

app.baseURL = 'http://codeigniter.test/'

When I change the base URL to the one used by Laragon (http://codeigniter.test/), an error occurs. What could be causing this issue?

Note: Previous versions of CodeIgniter do not have this error. I use version 4.4.1



esse erro:
Code:
Fatal error: Uncaught CodeIgniter\Exceptions\ConfigException: Config\App::$baseURL is invalid. in C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php:197 Stack trace: #0 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php(143): CodeIgniter\HTTP\SiteURI->normalizeBaseURL(Object(Config\App)) #1 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php(98): CodeIgniter\HTTP\SiteURI->determineBaseURL(Object(Config\App), NULL, NULL) #2 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURIFactory.php(222): CodeIgniter\HTTP\SiteURI->__construct(Object(Config\App), '/', NULL) #3 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURIFactory.php(43): CodeIgniter\HTTP\SiteURIFactory->createURIFromRoutePath('/') #4 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(798): CodeIgniter\HTTP\SiteURIFactory->createFromGlobals() #5 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::uri(NULL, false) #6 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(199): CodeIgniter\Config\BaseService::__callStatic('uri', Array) #7 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(791): CodeIgniter\Config\BaseService::getSharedInstance('uri', NULL) #8 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::uri() #9 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(565): CodeIgniter\Config\BaseService::__callStatic('uri', Array) #10 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(523): CodeIgniter\Config\Services::incomingrequest(Object(Config\App), false) #11 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::request(NULL, false) #12 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(199): CodeIgniter\Config\BaseService::__callStatic('request', Array) #13 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(519): CodeIgniter\Config\BaseService::getSharedInstance('request', NULL) #14 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::request() #15 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Debug\Exceptions.php(135): CodeIgniter\Config\BaseService::__callStatic('request', Array) #16 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(CodeIgniter\Exceptions\ConfigException)) #17 {main} thrown in C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php on line 197

Fatal error: Uncaught CodeIgniter\Exceptions\ConfigException: Config\App::$baseURL is invalid. in C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php:197 Stack trace: #0 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php(143): CodeIgniter\HTTP\SiteURI->normalizeBaseURL(Object(Config\App)) #1 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php(98): CodeIgniter\HTTP\SiteURI->determineBaseURL(Object(Config\App), NULL, NULL) #2 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURIFactory.php(222): CodeIgniter\HTTP\SiteURI->__construct(Object(Config\App), '/', NULL) #3 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURIFactory.php(43): CodeIgniter\HTTP\SiteURIFactory->createURIFromRoutePath('/') #4 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(798): CodeIgniter\HTTP\SiteURIFactory->createFromGlobals() #5 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::uri(NULL, false) #6 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(199): CodeIgniter\Config\BaseService::__callStatic('uri', Array) #7 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(791): CodeIgniter\Config\BaseService::getSharedInstance('uri', NULL) #8 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::uri() #9 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(565): CodeIgniter\Config\BaseService::__callStatic('uri', Array) #10 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(523): CodeIgniter\Config\Services::incomingrequest(Object(Config\App), false) #11 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::request(NULL, false) #12 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(199): CodeIgniter\Config\BaseService::__callStatic('request', Array) #13 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\Services.php(519): CodeIgniter\Config\BaseService::getSharedInstance('request', NULL) #14 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Config\BaseService.php(258): CodeIgniter\Config\Services::request() #15 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Debug\Exceptions.php(135): CodeIgniter\Config\BaseService::__callStatic('request', Array) #16 C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\Debug\Exceptions.php(236): CodeIgniter\Debug\Exceptions->exceptionHandler(Object(ErrorException)) #17 [internal function]: CodeIgniter\Debug\Exceptions->shutdownHandler() #18 {main} thrown in C:\laragon\www\teste_test\vendor\codeigniter4\framework\system\HTTP\SiteURI.php on line 197
Reply


Messages In This Thread
Issue with Base URL Configuration in CodeIgniter Using Laragon - by tarcisiodev1 - 10-16-2023, 05:11 PM



Theme © iAndrew 2016 - Forum software by © MyBB