CodeIgniter Forums
unstable new 4.5.1 installation - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28)
+--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30)
+--- Thread: unstable new 4.5.1 installation (/showthread.php?tid=91045)



unstable new 4.5.1 installation - wine-fine - 06-10-2024

I've downloaded the new version - the usual procedure: not working.

So I have several subdomains and start with the original 4.5.1 files: working fine. Then I add my controllers etc. and check manually where problems appear.

the debug bar is not working in http subdomains. The JS is located at mydomain.com/index.php?debugbar.js - but there is no index.php also an error in console is displayed:
Refused to execute as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type. the x-content-type deleted in htaccess

in one subdomain my files work, if CI_ENVIRONMENT = development is not set in the .env - otherwise the screen is just white.

in the other subdomain I get an Exception #403 error. no matter that the files are the same as in the other subdomains.

and in the third subdomain everything works fine - except the debug bar.

in one main https subdomain, everything works perfect

I'm working for two decades with CI and toying around with each new version is quite annoying.

how can I use the debugbar in non https subdomains?
how can the development environment stop the site from working?

Hope there are some hints.

Thank you in advance


RE: unstable new 4.5.1 installation - ozornick - 06-10-2024

As a developer, you must provide data on errors, settings, screenshots and behavior. We forum users can't say anything without the source data.
What are the settings the .env of each domain?

 If there is index.php in the address, it means it is not disabled. or do you have a special server configuration (windows, nginx, docker...)

When Environment is not set, Production mode is enabled. In this mode, errors are not shown, a white page is possible.

Personally, I'm not putting the first project, everything works fine


RE: unstable new 4.5.1 installation - wine-fine - 06-10-2024

To start with the debug bar

In the htaccess:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

APP.php: public string $indexPage = '';

as I wrote:

errors in console:
failed to load mydomain.com/index.php?debugbar.js
Refused to execute http://new.mydomain.de/index.php?debugbar as script because "X-Content-Type-Options: nosniff" was given and its Content-Type is not a script MIME type.

.env is commented out completely except: CI_ENVIRONMENT = development


RE: unstable new 4.5.1 installation - ozornick - 06-10-2024

I couldn't find the debugbar.js The JS code of the panel is executed dynamically, without a file http://demo/index.php?debugbar
а
Code:
<head>

<script  id="debugbar_loader" data-time="1718022291.836319" src="http://ci-demo/index.php?debugbar"></script>

Code:
document.addEventListener('DOMContentLoaded', loadDoc, false);

function loadDoc(time) {
    if (isNaN(time)) {
        time = document.getElementById("debugbar_loader").getAttribute("data-time");
        localStorage.setItem('debugbar-time', time);
    }

...
.htaccess exactly located right? The documentation suggests another option, without index.php
https://codeigniter4.github.io/userguide/installation/deployment.html#adding-htaccess

If you are hampered by CSP restrictions, comment out the line secureheaders in Config/Filters.php


RE: unstable new 4.5.1 installation - wine-fine - 06-10-2024

without https the console shows the two errors and no debug bar. with https there is no error and debug bar.

the coding errors are being displayed correctly.

the Exception #403 error was solved:

I commented out these lines:

$kuhkie['secure'] = TRUE;
$kuhkie['httponly'] = TRUE;

set_cookie($kuhkie);

site loaded. removed the comments and site still loaded.

I might understand any error due to the cookies but no #403.

thank you for your help!