IIS configuration PHP Environment (fast latest version)

Source: Internet
Author: User
Tags configuration php vc9
Today, a small web needs PHP environment to run, in order to configure, a painstaking effort! Finally, you can show:

We know that there are several PHP configurations:

1, CGI loading PHP environment, usually IIS inside the configuration interpreter for Php.exe, early more common, currently less use.
The characteristic is: stable, but the efficiency is too low.

2, the ISAPI mode loading PHP environment, is usually IIS inside the configuration interpreter for Php5isapi.dll, the current use of the most, the most widely used.
Features are: multithreading, high efficiency, but not stable enough.

3, fastcgi mode loading PHP environment, in the IIS environment is not common, but other system environment application is still there, but IIS7.0 began to build fastcgi.
Characteristics are: High efficiency, stability, belongs to the future development trend.

I've tried other special problems, and the version of Windows released by PHP 5.3 doesn't support ISAPI mode, so I'm going to run PHP in the fastcgi way recommended by Microsoft.

I use the third, but also the best and fastest, because fastcgi greatly enhanced the ability of IIS to handle PHP, can quickly improve the speed and productivity of the PHP site,

and has a higher stability and security.

Download Address: http://windows.php.net/download/There are many kinds of, want that?

PHP is now available in version 5.3.2, but there are several different versions to choose from when downloading. That's VC6 X86 and VC9 X86.
First I will answer:
What is VC6?
VC6 is Legacy Visual Studio 6 compiler, which is compiled with this compiler.
What is VC9?
VC9 is the Visual Studio compiler, which is compiled with Microsoft's vs Editor.

So how do we choose which version of PHP to download?
If you are using apache+php under Windows, please select the VC6 version;
If you are using iis+php under Windows, please select the VC9 version;

What is the non Thread safe?
Non thread safe is non-threaded;
What is Thread Safe?
Non thread safe;

FastCGI execution is performed in a single thread, so there is no need for thread security checks, and removing thread security checks can improve execution efficiency, so if PHP is executed in FastCGI (whether with IIS 6 or IIS 7), it is recommended to download, execute Non-thread Safe PHP (PHP's two-bit??? Package? Way: MSI, Zip,? Zip kit) So we chose No-thread Safe version of PHP to use.
Thread safety checks are prepared for the ISAPI way of PHP, because there are many PHP modules that are not thread-safe, so you need to use the thread safe PHP.

To download the installation, I install the default path:

Remember to check the third item: IIS FASTCGI

If you do not have IIS fastcgi installed Next, you will be prompted to download the installation.

FastCGI for IIS 6 7 http://www.iis.net/expand/fastcgi

After the installation, continue to the next step, I follow the default:

Once the installation is complete, it is configured.

There are two ways to configure this, and I'm going to use CMD to configure a single command.

Go to the directory where you just installed the CGI:

>CD C:\WINDOWS\system32\inetsrv

>cscript fcgiconfig.js-add-section: "PHP"-extension:php-path: "C:\Program files\php\php-cgi.exe"

Note: path: "Xxxx\php-cgi.exe" is the directory where you install PHP

> cscript fcgiconfig.js-set-section: "PHP"-instancemaxrequests:10000
> cscript fcgiconfig.js-set-section: "PHP"-environmentvars:php_fcgi_max_requests:10000

Ok! finished!

Under test:

Create a new. php file, Inside

Phpinfo ();

?>

Save!

Run, the following page appears, stating that the configuration was successful!

This way IIS does not have to configure, he will be automatically configured! The configuration provided by Microsoft is more detailed!

If you run the PHP test page with the tutorial configured as above, there is a 500 error.

Then set the Date.timezone entry in the php.ini.

I set it here to Shanghai time zone: Date.timezone = asia/beijing

After the setup, everything is fine!

  • 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.