Link to home
Start Free TrialLog in
Avatar of mganesh
mganeshFlag for United States of America

asked on

Problem with php files and mysql_connect when mod_auth_mysql is used

Recently, I downloaded mod_auth_mysql 3.0, compiled it and added the module into apache configuration file as

LoadModule mysql_auth_module modules/mod_auth_mysql.so

I added the .htaccess file in to one of my web directories as follows,

AuthName "Authorization Required"
AuthType Basic

AuthMySQLEnable On
AuthMySQLHost localhost
AuthMySQLPort 3306
AuthMySQLSocket /var/lib/mysql/mysql.sock
AuthMySQLUser <myusername>
AuthMySQLPassword <mypassword>
AuthMySQLDB intranet
AuthMySQLUserTable userinfo
AuthMySQLNameField username
AuthMySQLPasswordField password
AuthMySQLPwEncryption none

require valid-user

Now,

The authentication against the database is happening properly, but, the problem is,

all php pages where there is a mysql_connect function, are not executing, but come up for file download. If I remove the mod_auth_mysql.so from apache configuration and restart the server, all php files run smoothly.

The apache version is httpd-2.0.46-25.ent (rpm)
PHP Version is php-4.3.2-8.ent (rpm)
MySQL version is 5 (Downloaded .tar.gz and compiled)

What could be the problem ? Any guidance will be appreciated
Avatar of star_trek
star_trek

try taking out
AuthMySQLSocket /var/lib/mysql/mysql.sock
in .htaccess file.
Avatar of mganesh

ASKER

OK,
I solved it, it was a version problem. The original version of mod_auth_mysql installed on the system was mod_auth_mysql-20030510-1.ent on which I downloaded and installed mod_auth_mysql 3.0.

I removed the newer version and installed back the older mod_auth_mysql-20030510-1.ent.

Everything is alright now.
ASKER CERTIFIED SOLUTION
Avatar of GranMod
GranMod

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial