Php 未从htaccess中的SetEnv变量获取$\u服务器中的值

Php 未从htaccess中的SetEnv变量获取$\u服务器中的值,php,.htaccess,codeigniter,cpanel,mod-env,Php,.htaccess,Codeigniter,Cpanel,Mod Env,我已经在.htaccess文件中使用SetEnv设置了一些变量,但它不是通过php文件使用$\u SERVER获取的 以下是htaccess的代码: RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?/$1 [

我已经在.htaccess文件中使用SetEnv设置了一些变量,但它不是通过php文件使用$\u SERVER获取的

以下是htaccess的代码:

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
AddDefaultCharset utf-8

# Enviroment variables; change these to match server configurations
SetEnv ENVIRONMENT development
SetEnv APP_DB_HOSTNAME localhost
SetEnv APP_DB_USERNAME root
SetEnv APP_DB_PASSWORD root
SetEnv APP_DB_NAME root_pro
SetEnv APP_ENC_KEY xxxxx-xxx-xxx
但是我在$\u服务器['ENVIRONMENT']中没有得到值。请给我一些建议

注意:这在我的live server中不起作用,并且已经启用了mod_env


提前谢谢。

确保
AllowOverride
设置为FileInfo(或全部):

在相关目录中


此外,suexec可能删除了环境变量。

确保正确设置了
AllowOverride
。如何使用cPanel或whm登录进行检查或更改?是的,只有AllowOverride。但还是有同样的问题。
AllowOverride FileInfo