Welcome Guest, Not a member yet? Register   Sign In
Issues with development mode after CI 4 upgrade and replatform to Debian
#1

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 Smile
Reply
#2

(This post was last modified: 02-07-2023, 03:30 AM by kenjis.)

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
Reply
#3

(02-07-2023, 03:24 AM)kenjis Wrote: 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

Thanks Kenjis, the period was missing windows-->linux :/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB