2

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>
Ali.Ghodrat
  • 3,348
  • 3
  • 31
  • 31

3 Answers3

2

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.

You can check loaded modules with apachectl -M

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.

covener
  • 17,402
  • 2
  • 31
  • 45
2

To enable mod_env: sudo a2enmod env

Then restart apache: sudo systemctl restart apache2

Thomas Weller
  • 55,411
  • 20
  • 125
  • 222
O Red
  • 145
  • 2
  • 13
1

I was running CentOS release 6.10 and did not have a2enmod available. I had to use yum: yum install ea-apache24-mod_env.x86_64 once installed, my 500 error went away and the SetEnv directive worked properly again.

edward
  • 11
  • 2