Problem with php files and mysql_connect when mod_auth_mysql is used

Posted on 2006-04-18
Last Modified: 2013-12-12
Recently, I downloaded mod_auth_mysql 3.0, compiled it and added the module into apache configuration file as

LoadModule mysql_auth_module modules/

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


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 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
Question by:mganesh
    LVL 11

    Expert Comment

    try taking out
    AuthMySQLSocket /var/lib/mysql/mysql.sock
    in .htaccess file.
    LVL 3

    Author Comment

    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.

    Accepted Solution

    Closed, 500 points refunded.
    The Experts Exchange
    Community Support Moderator of all Ages

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
    These days socially coordinated efforts have turned into a critical requirement for enterprises.
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now