Set an environment variable in .htaccess and retrieve it in PHP

后端 未结 2 1816
粉色の甜心
粉色の甜心 2020-11-29 06:59

I am trying to set an environment variable in an .htaccess file and retrieve it in PHP. I\'ve looked through a bunch of other threads here on SO but everything I\'ve tried s

2条回答
  •  野性不改
    2020-11-29 07:51

    Assuming your configuration has AllowOverrides with .htaccess, you must enable mod_env in Apache for this to work.

    Apache - mod_env

提交回复
热议问题