(SHORT VERSION: dump the mythweb.conf file and put it's contents in the httpd.conf file as a <Directory> directive)
So you're trying to setup MythWeb for MythTV and you're getting this error:
Database Setup Error
The database environment variables are not correctly set in the web server conf or .htaccess file. Please read through the comments included in the file and set up the db_* environment variables correctly. Some possible solutions are to make sure that mod_env is enabled in httpd.conf, as well as having followed the instructions in the README and INSTALL files.
It happened to me, and about 95% of the answers I found related to MythDora, Debian, KnoppMyth or Ubuntu or some other system that heavily favors pre-compiled binary packages. I'm running Slackware and compiling MythTV and it's associated components so those answers didn't apply well here.
Additionally, a great deal of the answers involved .htaccess files. I'm running Apache2 and while .htaccess files will certainly work with Apache2, they are not the recommended method.
MythWeb setup problems often lead back to one or more of these four settings being incorrect in your mythweb.conf file:
For many people this turns out to be the source of the problem, so if you haven't double checked the mysql database settings in your mythweb.conf file do so now. My mythconverg settings were correct however, so that was not the issue.
I was then concerned about the placement of the mythweb.conf file. I had originally placed the file the in /usr/local/apache2/conf/extra dir but I had concerns that apache was not seeing it there so I made a symlink to it in the /usr/local/apache2/conf dir. Still no luck.
If you examine the mythweb.conf file closely you'll realize that it's just a heavily commented <Directory> directive and those can (and should) be placed within the actual httpd.conf file.
I copied all the data from my mythweb.conf file (sans the comments) and pasted the data into my httpd.conf file as a <Directory> directive. I restarted httpd and BAM, everything worked perfectly. I'm sure that there is a way to make apache see the mythweb.conf file in the /apache2/conf/extra dir, but all I know is that this method works and has no discernible downsides.
FYI: Here's a copy of the exact data (excluding my password) that I copied into my httpd.conf file:
<Directory "/usr/local/apache2/htdocs/mythweb" > <Files mythweb.*> setenv db_server "localhost" setenv db_name "mythconverg" setenv db_login "mythtv" setenv db_password "YOUR-MYTHTV-MYSQL-PASSWORD-HERE" </Files> <Files *.php> php_value safe_mode 0 php_value memory_limit 32M php_value register_globals 0 php_value magic_quotes_gpc 0 php_value file_uploads 0 php_value allow_url_fopen On php_value zlib.output_handler Off php_value output_handler NULL </Files> RewriteEngine on RewriteBase /mythweb RewriteRule ^(css|data|images|js|themes|skins|README|INSTALL|[a-z_]+\.(php|pl))(/|$) - [L] RewriteRule ^(pl(/.*)?)$ mythweb.pl/$1 [QSA,L] RewriteRule ^(.+)$ mythweb.php/$1 [QSA,L] RewriteRule ^(.*)$ mythweb.php [QSA,L] AllowOverride All Options FollowSymLinks AddType video/nuppelvideo .nuv AddType image/x-icon .ico <Files *.pl> SetHandler cgi-script Options +ExecCGI </Files> </Directory>