PHP and MySQL on IIS 6
MySQL, PHP August 7th, 2008I went to install Wordpress, but I got this error when I ran wp-config.php:
PHP has encountered an Access Violation at 0202B75A
A test phpinfo() file also displayed a completely blank page. Even a simple echo yielded the same results. Obviously php was not configured correctly.
Turns out the installer is not the way to go. After checking the settings and reinstalling several times, I followed these steps.
Progress! But I was now getting the following error - clearly a permissions issue:
HTTP Error 401.3 - Unauthorized: Access is denied due to an ACL set on the requested resource.
After setting the basic permissions to no avail, I crawled back to google. After another 30 minutes of searching, I came across this post.
The trick was adding the appropriate users with “Read & Execute”, “List Folder Contents”, and “Read” permissions, then clicking “Advanced”, then checking “Replace permission entries on all child objects…”, then “Apply”. Specific to my server, I gave IUSR_TEMPLATE and IIS_WPG access.
phpinfo() now displayed the php config! Considering it’s been as simple as running the installer for me before, this seemed like quite a hassle.
At this point in my Wordpress installation, I excitedly ran wp-config.php, which abuptly stated, “Your PHP installation appears to be missing the MySQL extension which is required by WordPress.”
Horseradish. Neither extension lines for mysql.dll and mysqli.dll were commented.
Then I found this post, which explains the PHPRC environment variable must be set to your php path. This didn’t fix the error, but since I did notice before that the variable was being created by the PHP installer, I left it.
Next, I found a walkthrough that said to copy the libmysql.dll file from c:\php to c:\windows\system32. He also questions why IIS doesn’t just read it from the php directory, since the dir is in the Path environment variable…who knows. I restarted IIS and HOORAH! As you can see, I’m up and running.
September 27th, 2008 at 8:21 am
A thousand thankyous for this wonderful post. After struggling with these mysterious access violations for far too long, I finally came across your article which pulls together everything I needed.
And it actually worked.
Make that a thousand and one thank yous.
Cheers
Barry
October 3rd, 2008 at 11:24 am
Glad to help! This was a frustrating process for me too, since the install worked on a couple other machines before.
November 18th, 2008 at 8:31 am
Found your blog which seemed to meet my needs but upon reading it is not quite so, however, I hope that you might be in a position to point me in the right direction. I get the “PHP has encountered an Access Violation” error bot PHP and MYSQL is correctly set up already as can be proven by a test page. Added to this I have confirmed that iusr has read, write, delete permissions to the temp, session and wordpress folders. Any pointers gratefully appreciated.
May 5th, 2009 at 3:17 am
I restarted my server and the problem went away. any idea on how to prevent it from happening again?
thank you.
September 19th, 2009 at 1:09 pm
Thank you sooooo much. The copying of the libmysql.dll file into the system32 folder and restarting IIS did the trick for me. Been searching for the answer for many hours. Greatly appreciated!
November 3rd, 2009 at 12:02 pm
Good! It’s amazing the tiny snags that hold us up…
December 3rd, 2009 at 11:21 am
Great read, Ill come back
January 5th, 2010 at 2:58 pm
Copied libmysql.dll into system32 folder and re-started IIS and now it is working well. Thanks
June 14th, 2010 at 5:33 am
Thank you SOOOO much. I must have read every post on the internet before this one regarding the ACL error. You have saved my sanity