In your index.php file try something like this:
if ($_SERVER['HTTP_HOST'] == 'dev' || $_SERVER['HTTP_HOST'] == 'localhost') { define('ENVIRONMENT', 'development'); } elseif ($_SERVER['HTTP_HOST'] == 'staging.example.com') { define('ENVIRONMENT', 'staging'); } else { define('ENVIRONMENT', 'production'); }
Obviously set it up with values โโthat make sense to you. However, this will set the ENVIRONMENT based on where the application is running, automatically.
source share