Welcome Guest, Not a member yet? Register   Sign In
Page request fails to load debug toolbar.
#1

(This post was last modified: 03-21-2021, 11:22 AM by codeguy.)

I've tried all suggestions here and in SO.

.env: CI_ENVIRONMENT = development
app/Config/App.php: public $baseURL = 'http://localhost/MZCI4/public/';

If I place echo "First controller test";  at top of controller index() function, it appears on blank page immediately after I enter the URL into the browser address bar.

Then CI4 waits about 4 seconds and then shows the actual requested page, correctly. But no debug icon shows at lower right corner.

Firefox "Inspect Element", network view, issues a warning at bottom: "Loading failed for the <script> with source “http://localhost/MZCI4/public/index.php?debugbar".

The network timing view shows 3 GETs. " 3 requests 30.94 KB / 31.24 KB transferred Finish: 6.57 s DOMContentLoaded: 6.55 s
load: 6.59 s". It pauses on the middle Get, to load the debug toolbar, for about 4 seconds. It then completes the page load and issues the warning.

The inspector view shows the html for making the requests.

Any help is appreciated.
Reply
#2

(This post was last modified: 03-21-2021, 01:43 PM by codeguy.)

I just found the solution to this question. If it helps anyone else, here's what I did wrong:

During apache setup I found I had to use port 8080 instead of port 80. So, I replaced the default line in my httpd.conf file, "#Listen 12.34.56.78:80" with "Listen 8080".

My error was that I did not also add the port number in my browser request URL and in the $baseURL in .env file to httpd://localhost:8080/MZCI4/public Both of these appear necessary.

Also, it turns out that I did not change the line public $baseURL = http://localhost/MZCI4/public in my app/Config/App.php file to public $baseURL = 'http://localhost:8080/MZCI4/public/';

But changing that line has no effect because the .env entry supersedes the app Config entry, as I would expect. Still, I changed it to match the .env file for consistency.

Now the page loads in 150 ms and includes the debug icon and functions.

Hope that helps someone.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB