Issues with development mode after CI 4 upgrade and replatform to Debian |
Hi Team,
I have been hitting my head against the wall all weekend. I have just moved the hosting environment from Windows (Apache 2, CI 4.0, PHP 8.0) to Debian 11 (Apache 2.4, CI 4.3 PHP8.2). I've managed to get an appstarter app page loading) but I cannot seem to get the env to accept that it's in development and not prod. As a result my errors end up with the Whoops page, which makes the debugging and issue resolving process slow and cumbersome So far I have The site .env file (located in the \appstarter directory) containing CI_ENVIRONMENT = development..... no diff Added the line $_SERVER['CI_ENVIRONMENT'] = 'development' in the \public\index.php... no diff renamed all of the .htaccess to .htaccess_dont just to get them out of the way in the Home controller I have echo $_SERVER['CI_ENVIRONMENT']; phpinfo(); return view('welcome_message'); Without $_SERVER['CI_ENVIRONMENT'] = 'development' in the \public\index.php, the controller crashes. When it is in, the controller runs as expected, reporting "development", the phpinfo() and the welcome message. When I add an echo 1/0, I once again get the Whoops screen, telling me that the env thinks it is in production. Where else is this value set ? Thanks for your help
Copy env file to .env in your project root folder, and set CI_ENVIRONMENT = development
See also https://codeigniter.com/user_guide/gener...t-constant (02-07-2023, 03:24 AM)kenjis Wrote: Copy env file to .env in your project root folder, and set CI_ENVIRONMENT = development Thanks Kenjis, the period was missing windows-->linux :/ |
Welcome Guest, Not a member yet? Register Sign In |