jeudi 18 juillet 2019

How do I get apache conf environment variables?

In my apache conf file I have the following

<VirtualHost *:443>
    DocumentRoot "...."
    ServerName test-mexico.local

    SetEnv ENV_NAME local
    SetEnv SITE_LOCALE es

    <Directory ....>
        Require all granted
        Allow from All
        AllowOverride All
    </Directory>
</VirtualHost>

<VirtualHost *:443>
    DocumentRoot "..."
    ServerName test-france.local

    SetEnv ENV_NAME local
    SetEnv SITE_LOCALE fr

    <Directory ...>
        Require all granted
        Allow from All
        AllowOverride All
    </Directory>
</VirtualHost>

I have several posts saying using getenv('SITE_LOCALE') will grab the variable however I tried this and it doesn't return anything. I tied to set the locale in config/app.php with 'locale' => getenv('SITE_LOCALE'), and it doesn't work

I am thinking there is something missing to bridge the gap but I am not a backend developer and not sure why this isn't working.

Also tried to print this out in the view with and also returns nothing

How can I retrieve the variables in my apache conf file?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire