IIS 7 and Above
FastCgiModule Error w/ PHP and MySQL
Last post Jan 08, 2011 06:29 AM by HCamper
Jan 07, 2011 12:19 PM|ChrisB5|LINK
Jan 07, 2011 01:01 PM|HCamper|LINK
I have the following setup:
Windows Server 2008 64-bit OS
PHP 5.3.4-NTS Win32 VC9 x86 (usd the zip archived file)
MySQL 5.1.51 (installed w/ msi file)
I installed PHP and MySQL on IIS. PHP works perfectly fine when I run my codes, but as soon as I connect to MySQL, I get an error page. Here's the PHP/MySQL code that generates the error:
$password = 'test';
$database = 'test';
mysql_connect($host, $username, $password);
if(mysql_connect($host, $username, $password))
echo "Successfully Connected to MySQL
echo "Successfully Connected To Database";
echo "Could Not Connect To Database";
echo "Could Not Connect to MySQL";
And below is the error I get. I've been trying to look at this for almost a week. If anyone could assist me, I would greatly appreciate it. Let me know if you need any additional information.
Server Error in Application "DEFAULT WEB SITE"Internet Information Services 7.5
HTTP Error 500.0 - Internal Server Error
The page cannot be displayed because an internal server error has occurred. Detailed Error Information
Error Code 0x00000000
Requested URL http://localhost:80/testMySQL.php
Physical Path C:\inetpub\wwwroot\testMySQL.php
Logon Method Anonymous
Logon User Anonymous
Most likely causes:
•IIS received the request; however, an internal error occurred during the processing of the request. The root cause of this error depends on which module handles the request and what was happening in the worker process when this error occurred.
•IIS was not able to access the web.config file for the Web site or application. This can occur if the NTFS permissions are set incorrectly.
•IIS was not able to process configuration for the Web site or application.
•The authenticated user does not have permission to use this DLL.
•The request is mapped to a managed handler but the .NET Extensibility Feature is not installed.
Things you can try:
•Ensure that the NTFS permissions for the web.config file are correct and allow access to the Web server's machine account.
•Check the event logs to see if any additional information was logged.
•Verify the permissions for the DLL.
•Install the .NET Extensibility feature if the request is mapped to a managed handler.
•Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here. Links and More InformationThis error means that there was a problem while processing the request.
The request was received by the Web server, but during processing a fatal error occurred, causing the 500 error.
View more information »
Microsoft Knowledge Base Articles:
Sorry you havng a problem,
item 1.) When you create a new web document you need
permissions to execute code and scripts in the site.
You will need to use IIS Manager and go to the default site.
In the panel is an item labeled permissions you need open this item.
After the permissions are open there several tabs.
Select the tab marked security open the tab look at the accounts and select the "IUSR" account.
Set the permissions for the "IUSR" to read,execute. Close the tab.
Exit IIS Manager for now.
Close the permissions panel. Press the top button marked restart web server.
item 2.) The second problem for using PHP is the settings may not be correct.
I would suggest that you go to the IIS NET Download Center and get the PHP Manager.
Download the PHP Manager installer and place in a folder of your choice run the installer.
After the installer is done open up the IIS Manager there will be a new panel in the management
section PHP Manager. Open the panel and check or change the settings using the manager.
Uing the top button restart the web server.
item 3.) Try the code mysqltest.php.
item 4.) If the script works or not post the results back to this thread.
If you have questions post them to this thread.
Jan 08, 2011 06:29 AM|HCamper|LINK
Do you still have problems?
If so post the questions to this thread.