Windows R2 Configuring PHP (FastCGI) environment with PHP Manager for IIS

Source: Internet
Author: User
Tags configuration php php software vc9 windows 5 windows x86 microsoft iis
As Microsoft has gradually begun to pay attention to the application of PHP on Windows, the introduction of the Microsoft Web platform,php Manager and other IIS platform tools, x86 and x64 system can be used, no longer to configure PHP on IIS, the PHP The manager uses the following:

* Associated PHP and IIS
* Run multiple PHP versions in parallel on the same server, even on the same Web site
* Check PHP Runtime configuration and environment (the output of the Phpinfo () function)
* Configure various PHP settings
* Enable or disable PHP extensions
* Remote Management php.ini PHP configuration file

So always want to experience the next PHP for IIS7.5, below share under WIN7 IIS7.5 on the application of the PHP Manager installation configuration PHP5 experience and feelings.

I used Microsoft Web Platform to install PHP Manager and PHP on Win R2, first of all on the Microsoft Web Platform platform (or you can not install Microsoft Web Platform )。

Microsoft Web Platform is a platform for Microsoft's integrated development language and applications, and through the Microsoft Web Platform Installer You can install development platforms such as ASP. NET, PHP, and corresponding WEB applications. White point is a bit like a software store.

1. Download Microsoft Web Platform 3.0 from the official Microsoft Web site and install it (optional):
Official Download Address:
http://www.microsoft.com/web/
Http://www.microsoft.com/web/downloads/platform.aspx

The default installation path is: C:\Program files\microsoft\web Platform Installer

2. Download with Microsoft Web Platform search or download the latest PHP Manager for IIS separately and install:
Download Address: http://phpmanager.codeplex.com/releases/view/53121

3. Download from Microsoft Web Platform search or download the latest PHP separately.
PHP official website Download Address:
http://windows.php.net/download/
Microsoft Official installs the PHP address through the Web installation platform:
Http://www.microsoft.com/web/platform/phponwindows.aspx

Windows R2 below IIS7.5 has greatly improved support for FASTCGI, the version of Windows released by PHP 5.3 already does not support ISAPI mode, because fastcgi greatly enhances the ability of IIS to handle PHP, Can quickly improve the response speed and productivity of the PHP site, and has higher stability and security, we do not recommend that friends use Php-isapi mode again.

This environment to build all the versions have been tested many times to ensure the correct! In view of the current php5.3.1 is not perfect to support the mainstream PHP system, not recommended for everyone to use!

windows2008 R2 under the environment under the two circumstances of the situation we can choose according to their own operation needs!
1 Iis7.5+php+mysql+wincache 1.0RC
This environment is a combination of people who have seen no Zend,
Each version is:
php5.2.11--Note the non-thread-safe (Non Thead Safe) version of the PHP 5.2.11 non-thread-safe zip package,
MYSQL5.0 x64,
WINCACHE1.0RC for5.2, this everyone can go to Microsoft IIS official download, he will greatly improve the efficiency of your system running!
If your server is running open source programs and does not require Zend, it is highly recommended that you use this configuration!

2 Iis7.5+php+mysql+zend+xcache
This combined version is
PHP5.2.11 Please note that it is thread safe (Thead safe) version: PHP 5.2.11 Zip Package
MYSQL5.0 x64,
Zendoptimizer3.3.3-windows x86
Xcache1.3 for Xcache-1.3.0-php-5.2.10-win32-vc6-x86.zip
This combination can perfectly run today's mainstream PHP system, but in the ointment is the use of PHP thread-safe version can not load Wincache, it is a pity! But you can use XCache as a supplement, but it's much better than PHP-ISAPI mode!

Attention:
The official website has indicated that the VC9 version is for IIS, and the VC6 version is for Apache. The reason for this distinction is that the VC9 version is compiled with Visual Studio 2008, and the compiler performs more optimizations on the program, which makes the performance better. As for Thead safe (thread safe)/non Thead Safe (non-thread safe), the official website does not specify what their purpose is. After Google, I found the answer: FASTCGI is a single-threaded execution, and therefore does not require a thread-safe version, the removal of thread-safe protection can improve execution efficiency, and the ISAPI mode is multithreaded, so the need to adopt a thread-safe version.

Description
Download PHP is x86 version, and Win2008 R2 is 64-bit system, should be used x64 version, but the official PHP does not provide x64 version, the use of x86 version, no change. The VC9 version of PHP 5.3 requires that the VC2008 runtime (32-bit/64-bit) be installed first.

A quick tutorial to install PHP in fastcgi mode can be viewed here: http://www.discuz.net/thread-2140092-1-1.html

4. Set up PHP Manager for IIS 1.2
Don't bother to grab a picture here, you can control your own system.

2011-9-18 17:31:17 Upload

Download accessories (27.19 KB)


Then select PHP Manager, click "Register New PHP Version", select your PHP extract directory

2011-9-18 17:31:17 Upload

Download accessories (44.05 KB)


After clicking "OK", the system will automatically activate the current PHP version.

2011-9-18 17:31:17 Upload

Download accessories (47.21 KB)


When a yellow warning appears, you can click "View Recommendations" to modify it according to the recommended settings.

2011-9-18 17:31:17 Upload

Download accessories (21.93 KB)


At the same time, you can also install multiple PHP version switch use, click "Check Phpinfo ()" To view the version information

2011-9-18 17:31:17 Upload

Download accessories (43.62 KB)


2011-9-18 17:31:17 Upload

Download accessories (186.32 KB)


Setting up Error Reporting

2011-9-18 17:31:17 Upload

Download accessories (178.05 KB)


Set PHP Run Limits

2011-9-18 17:31:17 Upload

Download accessories (179.08 KB)


Set PHP.ini

2011-9-18 17:31:17 Upload

Download accessories (168.68 KB)


PHP Add-ins settings

2011-9-18 17:31:17 Upload

Download accessories (201.33 KB)



OK, let's test it, create a new Notepad with the content:
Phpinfo ();
?>
Save As info.php, and then open its Web page file.

5. Install MySQL
Download the MySQL for Windows 5.1.57 x64 installation package and follow the configuration Wizard when the installation is complete.
Make your own move to the data folder to change the location, the way to modify the following:
1. Stop MySQL, enter and run in the command window: net stop MySQL;
2. Cut the Data folder in "C:\programdata\MySQL\MySQL Server 5.1\data\" to the destination, which is set to D:\Mysql5.1\data
3. Modify the My.ini file in the MySQL installation directory, find the code about "datadir=", change the DataDir to datadir= "D:\MySQL5.1\data\"
4. Start MySQL, enter and run in the command window: net start MySQL;

6. Installing Wincache
After Microsoft launched Windows Server 2008, PHP has been greatly optimized, but also released the Wincache in Windows to accelerate PHP software, the effect is significant. In some tests, Wincache scored better than Eaccelerator and XCache.

Wincache can be downloaded to Microsoft's IIS official website, only support fastcgi run mode, Non Thread safe version of PHP.

Wincache Download Address: http://www.iis.net/download/WinCacheForPhp

The Wincache version of the installation tutorial with fastcgi mode is in the upper right corner: for example:

2011-10-23 16:01:36 Upload

Download accessories (36.95 KB)



Install Wincache: Click on the downloaded EXE file, point ' YES ', and then appear a path selection box, select Unzip to your PHP installation directory in the Ext folder. Example: C:\Program files\php\ext

Then open the php.ini file, for example C:\Program Files\php\php.ini, and add a line at the bottom: extension = Php_wincache.dll

Restart IIS again.

Wincache will be displayed on the Phpinfo page after successful installation. Such as:

2011-10-23 16:01:36 Upload

Download attachments (KB)



Special Note:
1, before installing the configuration PHP on Win 2008, you first need to install the configuration of IIS7.5, and choose to install CGI, otherwise it may cause PHP installation is unsuccessful.
2, when you choose to download PHP Manager, PHP Manager has 32 and 64 bit two versions, the win R2 system is 64-bit, it is recommended to download the 64-bit version.
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.