Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 293
  • Last Modified:

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
0
mganesh
Asked:
mganesh
1 Solution
 
star_trekCommented:
try taking out
AuthMySQLSocket /var/lib/mysql/mysql.sock
in .htaccess file.
0
 
mganeshAuthor Commented:
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.
0
 
GranModCommented:
Closed, 500 points refunded.
GranMod
The Experts Exchange
Community Support Moderator of all Ages
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now