如何在 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 指令.它可能已经启用.如果不是,则模式将非常明显.
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屋!