IIS7 Configure the PHP environment graphics and text tutorial (fastcgi Fast latest edition) _win server

Source: Internet
Author: User
Tags install php vc9

We know that there are several PHP configurations:

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

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

3, fastcgi way to load the PHP environment, in the IIS environment is not common, but other systems environment applications are still available, but IIS7.0 began to build the built-in fastcgi.
Features are: High efficiency, stability, belong to the future development trend.

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

I use the third and best, because fastcgi greatly enhances the ability of IIS to handle PHP, and can quickly increase the response 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 inside, want that kind of?

PHP now launches version 5.3.2, but there are several different versions to download. That's VC6 X86 and VC9 X86.
First I will answer:
What is VC6?
VC6 is Legacy Visual Studio 6 compiler, which is compiled using this compiler.
What is VC9?
VC9 is the Visual Studio 2008 compiler, which is compiled with the Microsoft 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;

So what's non Thread safe?
Non thread safe is not threaded;
What is Thread Safe?
Non thread safe is threaded;
The authorities do not recommend that you apply non thread safe to the production environment, so we chose the PHP version of the thread safe to use .

Download the installation, I install the default path:

Remember to select the third item:IIS FASTCGI

If the next step for IIS fastcgi is not installed, you will be prompted to download the installation.

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

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

After the installation is completed, it is configured.

There are two ways of this configuration, I use CMD configuration, a command on the line.

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

<?php

Phpinfo ();

?>

Save!

Run, the following page appears, indicating that the configuration succeeded!

This way IIS does not have to configure, he will be automatically configured! Microsoft offers a more detailed configuration!

If you run the PHP test page with the following tutorial configured, there are 500 errors.

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

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

When you're done, everything's fine!

There are a couple of questions that need to be noted here: (Problems I encountered when I configured myself)

1. For the server of the empty machine, generally did not install any other database software, so everybody runs the C:Program Filesphpphp-cgi.exe, will there be a problem and then fix the problem. (Try running with cmd)

runs C:Program filesphpphp-cgi.exe, and if you can get into a command window and only the cursor, indicating that fastcgi can call php-cgi normally, you will be prompted with an error, such as the figure



2. Running the test page shows a 500 error (I ran into a problem and found a solution on the internet.)

Workaround:

Turn on IE----Internet Options--------Advanced------------Show friendly HTTP errors before the check out, and then the error will prompt you the wrong specific hint.

Tip:

PHP Warning:Unknown:open (C:phpupload_tmpsess_li3ardp5qtalfj4, O_RDWR) Failed:permission denied (Unknown on line 0 PHP Warning:

Unknown:open (C:phpupload_tmpsess_li3ardbp5qtalfj4, O_RDWR) failed:permi Ssion denied in Unknown on line 0, PHP Warning:Unknown:Failed

to write session data (files). Please verify that's the current setting of the Session.save_path was correct (c:phpupload_tmp) in Unknown to line 0

This says Ming I did not give c:phpupload_tmp write permission, to give. Write permission, resolve!

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.