Installing PHP on a Windows Server with IIS6


Installing PHP on a Windows Server with IIS6

Installing PHP 5.x on IIS5

  1. Search your server for libmysql.dll. Delete any instance of libmysql.dll, this limits the possibility of older MySQL client API's being used with PHP.

  2. Search your server for php_mysql.dll. Delete any instance of php_mysql.dll, this limits the possibility of older MySQL client API's being used with PHP.

  3. Unzip your php-5.x-Win32.zip file to C:\PHP this is where PHP will be installed at.

  4. Create a C:\PHP\phpsessions directory. This is the directory that PHP sessions will be saved to.

  5. Set the NTFS permissions on the C:\PHP folder and all child objects to allow the IUSR_COMPUTERNAME user FULL CONTROL. (Replace COMPUTERNAME with your servers computer name).

    • In Windows Explorer (in the C:\ directory) right click on the PHP folder and go to Properties.

    • Go to the Security Tab.

    • Click Add and type IUSR_COMPUTERNAME in the text area. Click Check Names and the field will be completed. Hit OK.



    • On the Security tab select the IUSR_COMPUTERNAME user and check the Full Control box at the bottom half of the screen. Then hit OK.



  6. Create your php.ini file.

    • Open up the C:\PHP\php.ini-dist file in a text editor. (Notepad will work).

    • Search for the line that looks like this...

      ;extension=php_mysql.dll

      Change this line to...

      extension=php_mysql.dll

    • Search for the line that looks like this...

      ;session.save_path = "/tmp"

      Change this line to...

      session.save_path = "C:\PHP\phpsessions"

    • Search for the line that looks like this...

      session.gc_maxlifetime = 1440

      Change this line to...

      session.gc_maxlifetime = 43200

    • Search for the line that looks like this...

      SMTP = localhost

      Change this line to reflect the hostname of your SMTP mail server...

      SMTP = smtp.mycompany.com

    • Search for the line that looks like this...

      ;sendmail_from = [email protected]

      Change this line to reflect the default email address you would like PHP to use...

      sendmail_from = [email protected]

    • Save the modified file as C:\%WIN%\php.ini

  7. Copy C:\PHP\libmysql.dll and C:\PHP\ext\php_mysql.dll to the C:\%WIN%\system32 folder.

  8. Open up the IIS manager by going to Control Panel > Administrative Tools > Internet Information Services (IIS) Manager

  9. Add PHP as a Web Service Extension

    • In the left column right click Web Service Extensions and select Add a new web service extension.



    • On the New Web Service Extension window for Extension Name enter php and check the Set extension status to Allowed. Click Add.



    • On the Add File window enter the path to C:\PHP\php5isapi.dll. Click OK.



    • You should now have all of the Web Service Extension information filled in. Click OK.



  10. In the IIS Manager on the left column. Right Click Web Sites and go to Properties.



  11. Add PHP as an ISAPI Filter.

    • Go to the ISAPI Filters tab. Click Add.

    • For the Filter Name enter php and for the Executable enter C:\PHP\php5isapi.dll. Click OK.



  12. Add an Application Extension Mapping for PHP

    • Go to the Home Directory tab. Click the Configuration Button.



    • On the Application Configuration window click Add to add a new mapping.

    • On the Add/Edit Application Extension Mappings window for Executable enter C:\PHP\php5isapi.dll and for Extension enter php. Leave the other options at their default settings. Click OK.



    • Click OK on the Application Configuration window.

  13. Add index.php as a Document Index file.

    • Go to the Documents Tab. Click Add. Enter index.php into the box. Click OK.



  14. Click OK on the Website Properties box.

  15. A new box may popup asking if you want to apply the settings to certain websites. Here you can either choose specifically which websites you want PHP enabled on or Select All. Click OK.



  16. Restart IIS

    • In the left column of the IIS manager right click your Computer Name and go to All Tasks > Restart IIS.



    • On the Stop/Start/Restart window choose Restart IIS from the dropdown menu and hit OK.



    • IIS will now restart.

  17. You should have PHP completely installed now. Now it's time to test it out.

    • Open up Notepad and start a new document. Add the following text into your new document.

      <?php phpinfo(); ?>

    • Save this new file to your website root as phpinfo.php.

    • Pull up your web browser and open up the phpinfo.php file in your web browser. You should have a output screen of all of PHP's info from your server.



    • If the page pulls up then PHP is working.

  18. If you do not already have MySQL installed. Please continue on to the Installing MySQL on a Windows Server article.


    ที่มาของข้อมูล :
    http://www.phplivesupport.com/documentation/viewarticle.php?uid=1&aid=78&pid=8
คำสำคัญ (Tags): #php#iis5#iis6
หมายเลขบันทึก: 127126เขียนเมื่อ 11 กันยายน 2007 16:32 น. ()แก้ไขเมื่อ 12 มิถุนายน 2012 15:43 น. ()สัญญาอนุญาต: จำนวนที่อ่านจำนวนที่อ่าน:


ความเห็น (0)

ไม่มีความเห็น

พบปัญหาการใช้งานกรุณาแจ้ง LINE ID @gotoknow
ClassStart
ระบบจัดการการเรียนการสอนผ่านอินเทอร์เน็ต
ทั้งเว็บทั้งแอปใช้งานฟรี
ClassStart Books
โครงการหนังสือจากคลาสสตาร์ท