Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get PHP and MySQL working on IIS 7.0?

Tags:

php

mysql

iis-7

Okay, I've looked all over the internet for a good solution to get PHP and MySQL working on IIS7.0. It's nearly impossible, I've tried it so many times and given up in vain. Please please help by linking some great step-by-step tutorial to adding PHP and MySQL on IIS7.0 from scratch. PHP and MySQL are essential for installing any CMS.

like image 692
z3r0p4r4d0x Avatar asked Aug 15 '08 03:08

z3r0p4r4d0x


People also ask

Does IIS support PHP and MySQL?

IIS is a set of Internet services from Microsoft, in other words, a web platform. The peculiarity of IIS is that it supports a large number of modules and applications, including work with MySQL and PHP. Installing IIS. Open the Server Manager.

How do I connect to SQL database in IIS 7?

Select the SQL Server option button. In the Server text box, type the name of the server that hosts your database. In the Database text box, type the name of the database to which you would like to connect. If your database uses Windows® Authentication, click on the Use Windows Integrated Security option button.


2 Answers

I've been given a PHP / MySQL web site that I'm to host with IIS 7.0 on 64-bit Windows Server 2008.

I'm a .NET / MSSQL developer, and am unfamiliar with either PHP or MySQL.

Kev wrote:

Have you taken a look at this…

I don't know if any one implementation of Win64 PHP is more authoratative or popular than another.

I'm going to try following the steps in Kev's Enable FastCGI support in IIS7.0 article with file php-5.2.5-x64-2007-11-12.zip from fusion-x lan.

It's "PHP Version 5.2.5 (x64)", but according to php.net, the latest version is PHP 5.2.6. Oh, well.


  1. Make sure "ISAPI Extensions" are installed in IIS (mine were).

  2. Download and then unzip php-5.2.5-x64-2007-11-12.zip

  3. Copy contents of folder php-5.2.5 (x64) into *C:\php*

  4. Copy file C:\php\php.ini-dist into folder *C:\Windows*

  5. Rename file C:\Windows\php.ini-dist as php.ini

  6. Edit php.ini in Notepad. Remove leading semi-colon (;) from line:

    ;extension=php_mysql.dll
    
  7. Save and close

  8. Copy file C:\php\ext\php_mysql.dll into folder *C:\Windows\System32*

  9. Within IIS Manager's "Handler Mappings", choose "Add Script Map…"

    Request path: *.php
    Executable:   C:\php\php5isapi.dll
    Name:         PHP
    
  10. Install MySQL (someone had already installed MySQL 5.0 for me).

  11. Create file C:\inetpub\wwwroot\test.php as

    <html>
    <head>
    <title>PHP Information</title>
    </head>
    <body>
    <?php phpInfo(); ?>
    </body>
    </html>
    
  12. Navigate to http://localhost/test.php in your web browser. You will see a page of information about PHP.


Roadblock: How do I get PHP to work with ADOdb and MySQL?

like image 198
Zack Peterson Avatar answered Sep 18 '22 15:09

Zack Peterson


Have you taken a look at this:

http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis7/

MySQL should be pretty straight forward.

Let us know what problems you're encountering...

like image 35
Kev Avatar answered Sep 20 '22 15:09

Kev