Welcome Guest, Not a member yet? Register   Sign In
error update form 4.3.7 to 4.4
#1

(This post was last modified: 08-25-2023, 01:01 AM by startup.)

i update to 4.4 , codeigniter 4.4 info message: "Fatal error: Uncaught Error: Undefined constant "CodeIgniter\ENVIRONMENT" in H:\HELPER\SERVER\htdocs\ciall\ci4\ci43\vendor\codeigniter4\framework\system\CodeIgniter.php on line 581"

protected function bootstrapEnvironment()
{
if (is_file(APPPATH . 'Config/Boot/' . ENVIRONMENT . '.php')) {
require_once APPPATH . 'Config/Boot/' . ENVIRONMENT . '.php'; line 581
} else {
// @codeCoverageIgnoreStart
header('HTTP/1.1 503 Service Unavailable.', true, 503);
echo 'The application environment is not set correctly.';

exit(EXIT_ERROR); // EXIT_ERROR
// @codeCoverageIgnoreEnd
}
}

how to fix it
thank you for helping
Reply
Reply
#3

I have the same problem, but I have no idea what to add in routeFiles to enable the env routing again.

I also wonder what to do with the entries in app/Config/Routes.php , do they all need to be removed? Where do I place the routes like this now?

PHP Code:
$routes->get('{locale}/register''Register::index');
$routes->post('{locale}/register''Register::create'); 


Thanks!
Reply
#4

nothing has changed. Just the router setup was made separately. All routes are in Routes.php
I would advise everyone who is updating to install a clean appstarter and transfer their files to it.
Reply
#5

Thank you!

I can not replace it, we have changed a lot. I merged the changes from the changelog into it on each update.

How can I add the env routing again?

I also get "Uncaught Error: Undefined constant "CodeIgniter\ENVIRONMENT""
Reply
#6

See https://codeigniter4.github.io/CodeIgnit...outing-php
Reply
#7

I had to rebuild everything and manually adjust all the data from the appstarter, now it is working again, thank you very much for your help.
Reply
#8

(08-30-2023, 11:35 PM)seechiller Wrote: I had to rebuild everything and manually adjust all the data from the appstarter, now it is working again, thank you very much for your help.

I put a copy from vendor/codeigniter4/framework/public/index.php to public/index.php > solved "Undefined constant "CodeIgniter\ENVIRONMENT" problem
Bart Goossens
Project Linde37
[email protected]
Reply
#9
Sad 

(09-17-2023, 07:31 AM)Project Linde37 Wrote:
(08-30-2023, 11:35 PM)seechiller Wrote: I had to rebuild everything and manually adjust all the data from the appstarter, now it is working again, thank you very much for your help.

I put a copy from vendor/codeigniter4/framework/public/index.php to public/index.php > solved "Undefined constant "CodeIgniter\ENVIRONMENT" problem

Copying the index files only doubled my Error messages?!???

What should be the exact solution?
Reply
Reply




Theme © iAndrew 2016 - Forum software by © MyBB