Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Win 2003, PHP 5.2.1 and IIS 6.

I have PHP configured as ISSAPI and it is serving PHP pages. When I try a page that requires MySQL I am getting just:

PHP has encountered an Access Violation at (and a RANDOM number)

What is all.

Google has not provided me with results that help me fix.

Does anyone have any thoughts?

share|improve this question
@zypher - the number is different each time. – JT Jan 5 '10 at 22:52
Ahh sorry, i'd edit the question to stat it's a random number - i take back my previous statement. – Zypher Jan 5 '10 at 22:57
This may sound like something dumb, but have you tried restarting the server? – Nathan Adams Jan 6 '10 at 2:42

Make sure mysql support has been enabled in your php.ini file.

Read this... specifically the Windows installation section.

share|improve this answer
@LukeR - I have c:\php in my path, I have the mysql extension uncommented. I have defined c:\php\ext in the php.ini file as well. – JT Jan 5 '10 at 23:00

This is an AGE-OLD problem that has probably been well solved by now, but even as of 6/2010 this link still manages to be one of the top hits in Google.

My solution to this problem:

share|improve this answer

Have you tried looking at the output of "php -m" and a phpinfo() page to see if the MySQL extension is actually being loaded?

A common problem with using the PHP MySQL extension on Windows systems is having mismatched versions of libmysql.dll and php_mysql.dll. If there are multiple copies of libmysql.dll on your server, I'd suggest making sure the one that matches your PHP version comes first in the server's PATH variable. (If you have MySQL installed on the server, I'd also suggest making sure it still works after you make any changes.)

Edited to add: The URL Luke mentioned discusses this a bit as well.

share|improve this answer

Above suggestion worked for me. Installed PHP and MySQL on a new server, using same PHP install from old server but a newer copy of MySQL. In the path it was finding a newer libmysql.dll from the MySQL/bin folder. Re-ordered the path to look at the PHP folder first, so it uses the libmysql.dll in that folder, and it worked.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.