如何在Apache中启用mod_env [英] How to enable mod_env in Apache
问题描述
我正在尝试为PHPMailer设置环境变量,并且需要在httpd.conf中启用 mod_env .我知道如果您使用的是Apache(并且启用了mod_env),那么可以在.htaccess中指定环境变量.这是XAMPP中的httpd.conf:
I'm trying to set Environment variables for PHPMailer and need to enable mod_env in the httpd.conf. I know if you're using Apache (and mod_env is enabled), then Envirnoment variables can be specified in .htaccess. Here is my httpd.conf in XAMPP:
Alias /bitnami/ "/Applications/XAMPP/xamppfiles/apache2/htdocs/"
Alias /bitnami "/Applications/XAMPP/xamppfiles/apache2/htdocs
<Directory "/Applications/XAMPP/xamppfiles/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
推荐答案
mod_env与其他模块一样,已通过LoadModule指令 loaded 或 enabled 加载.它可能已经启用.如果不是这样,则模式将非常明显.
mod_env is loaded or enabled like every other module, with the LoadModule directive. It's probably already enabled. If it isn't, the pattern will be quite obvious.
您可以使用apachectl -M检查加载的模块
You can check loaded modules with apachectl -M
如果要使用mod_env提供的指令,例如"SetEnv",则必须在手册中实际查找其语法并将其键入到您的配置中.
If you want to use directives provided by mod_env, like "SetEnv" you'll have to actually look up their syntax in the manual and type them into your configuation.
这篇关于如何在Apache中启用mod_env的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!