วันจันทร์ที่ 10 พฤศจิกายน พ.ศ. 2551

How to set php in windows 2003 R2 x64

มาดูวิธีเซ็ต php บน iis ของ windows 2003 R2 x64 กันดีกว่าครับ
As it turns out, the largest obstacle to completing a successful WordPress installation on a 64 bit Windows server is the fact that PHP does not distribute a 64 bit version of the PHP Windows Binaries. As a result, installation of PHP must be done manually using a third party package provided by Fusion-X LAN.

“This is the only known-of distribution for 64-bit PHP, or the “PHPx64 Project” (Windows x64)! With these binaries you’ll finally be able to use your 64-bit server hardware with powerful 64-bit software.”

I will detail the installation and configuration of PHP 5 on x64 Edition below:

Step-by-Step Installation Instructions:

PHP

  1. Download the latest version of the 64 bit PHP binaries from the website link provided above (in my case this was php-5.2.5-x64-2007-11-12.zip), extract the contents of the folder to “C:\PHP”.
  2. The IIS user (usually IUSR_MACHINENAME) needs permission to read files within the PHP directory, such as “php.ini”. Give the account READ permissions on the newly created directory.
  3. Within the “C:\PHP” directory, look for and rename the file named “php.ini-recommended” to “php.ini”
  4. Open “php.in” and set the extension_dir value to “C:\PHP\ext”
  5. Add the PHP directory to the PATH on Windows Server
    • Go to Control Panel and open the System icon
    • Go to the Advanced tab
    • Click on the ‘Environment Variables’ button
    • Look into the ‘System Variables’ pane
    • Find the Path entry (you may need to scroll to find it)
    • Double click on the Path entry
    • Enter your PHP directory at the end, including ‘;’ before (e.g. ;C:\PHP)
    • Press OK and restart your server
  6. Make the “php.ini” file available to PHP on Windows Server by setting the PHPRC environment variable:
    • Go to Control Panel and open the System icon
    • Go to the Advanced tab
    • Click on the ‘Environment Variables’ button
    • Look into the ‘System Variables’ pane
    • Click on ‘New’ and enter ‘PHPRC’ as the variable name and the directory where php.ini is located as the variable value (e.g. C:\PHP)
    • Press OK and restart your server

IIS

  1. Set IIS to run in 64 bit mode. From MS KB article 894435:
    • Click Start, click Run, type cmd, and then click OK.
    • Type the following command to disable the 32-bit mode:
      cscript %SYSTEMDRIVE%\inetpub\adminscripts\adsutil.vbs SET W3SVC/AppPools/Enable32bitAppOnWin64 0
    • Type the following command to install the version of ASP.NET 2.0 and to install the script maps at the IIS root and under:
      %SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\aspnet_regiis.exe -i
    • Make sure that the status of ASP.NET version 2.0.50727 is set to Allowed in the Web service extension list in Internet Information Services Manager.
  2. Open up the IIS 6 Manager, go to Web Service Extensions, choose “Add a new Web service extension”, enter in a name such as PHP, choose the Add button and for the value browse to the ISAPI file “C:\PHP\php5isapi.dll” then check “Set extension status to Allowed” and click OK.
  3. Restart your server

MySQL & WordPress

  1. Proceed with normal installations of MySQL & WordPress

Direct Links to Software in this Tutorial

  1. PHP x64 Edition (Download Here)
  2. WordPress (Download Here)
  3. MySQL Server x64 Edition (Download Here)/mysql-5.0.67-winx64.zip

ไม่มีความคิดเห็น: