mganesh
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
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
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.
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.
I removed the newer version and installed back the older mod_auth_mysql-20030510-1.
Everything is alright now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
AuthMySQLSocket /var/lib/mysql/mysql.sock
in .htaccess file.