I have a solution develop with PHP
- Framework Phalcon 3.4.5
- macOS 12.6
- PHP 7.3.33
- MAMP Pro 6
I have this .htaccess that is in my root folder:
A SetEnv directive is set like that:
<IfModule mod_env.c>
SetEnv APPLICATION_ENV=development
</IfModule>
The right env module are loaded in Apache:
- mod_env.so
- mod_setenvif.so
My host config have AllowAoverride All My AccessFileName is set to htaccess
I use this code in my index file to read the environment variable and I can't get the value.
defined('ENVIRONMENT') || define('ENVIRONMENT', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
echo ENVIRONMENT . PHP_EOL;
Considering the SetEnv in the htaccess, should get development has a value, but I keep getting production.
I did test to be sure that mod_env and mod_setenvif are loaded. There is no error in my apache log and php log.
I have no clue why. Any help will be welcome here?
Thank you!