CodeIgniter Forums
error update form 4.3.7 to 4.4 - 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: error update form 4.3.7 to 4.4 (/showthread.php?tid=88339)

Pages: 1 2


error update form 4.3.7 to 4.4 - startup - 08-25-2023

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


RE: error update form 4.3.7 to 4.4 - sammyskills - 08-25-2023

See this: https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_440.html#mandatory-file-changes


RE: error update form 4.3.7 to 4.4 - seechiller - 08-29-2023

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!


RE: error update form 4.3.7 to 4.4 - ozornick - 08-29-2023

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.


RE: error update form 4.3.7 to 4.4 - seechiller - 08-29-2023

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""


RE: error update form 4.3.7 to 4.4 - kenjis - 08-29-2023

See https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_440.html#app-config-routing-php


RE: error update form 4.3.7 to 4.4 - seechiller - 08-30-2023

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.


RE: error update form 4.3.7 to 4.4 - Project Linde37 - 09-17-2023

(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


RE: error update form 4.3.7 to 4.4 - MarcoB - 11-02-2023

(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?


RE: error update form 4.3.7 to 4.4 - kenjis - 11-02-2023

If you use v4.3.7, read the all related upgrading guides and do the things needed:
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_438.html
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_440.html
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_441.html
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_442.html
https://codeigniter4.github.io/CodeIgniter4/installation/upgrade_443.html