Windows nginx-0.7.10 + php-5.2.6 + fastcgi Installation Log

Source: Internet
Author: User
Tags apache php install php on windows
Author: Ayou has been a bit itchy recently and intends to get started with php. I found several servers and wanted to install php. Although it was just a little effort, it was a little inconvenient. In addition, the home broadband is always busy, so it is also painful to test on the server. So I want to get it on the local machine. Remember that there was an Integrated Installation version of apachephpmysql before.

Author: Ayou

My heart is a bit itchy recently, and I plan to get it donePhpPlay. I found several servers and wanted to install php. Although it was just a little effort, it was a little inconvenient. In addition, the home broadband is always busy, so it is also painful to test on the server.

So I want to get it on my local computer. I remember there was an Integrated Installation version of apache php mysql. This is a good thing. If someone asks me how to install php on windows, I just told him to find this, which can save a lot of effort.

But today I don't want to use this old device to install it. Although this East suit is fast, I don't remember how to write apache configuration, or even hate writing that configuration.

So I got a windows version of nginx, and then find another windows version of php, In the http://www.kevinworthington.com/CatEgory/computers/nginx/. Install nginx first after the download. It is not complicated to start. Enter http: // 127.0.0.1 in the browser. No response is returned. Check out the net.Stat-An: It seems that port 80 exists. It is estimated that this port is not occupied by nginx, so you can turn off all the enabled programs, start it, and refresh it. A test page appears.

In this case, we have finished something. install php first.ExtractTo d disk, put in d: php-5.2.6-win32 directory, a bit lengthy, but forget it, now old also don't want to be too entangled in this. Next, my thinking is a little short-circuited, because where can I find a spawn-fcgi on windows? No way, google it.

I opened more than a dozen web pages and introduced the ligHttpdThe article found a way, lighttpd is still very helpful for nginx, nginx installation of php method, linux and windows are lighttpd first, nginx can be copied later, they all use the same idea. The lighttpd article seems to provide a complete solution, from which I found a sentence:

Php-cgi-B 127.0.0.1: 521

This line is small.CommandYou can start the php-cgi process and port. However, this dos window will not be closed during running, which is also quite confusing. Therefore, according to this article, use a RunHiDdEnConsole.ExE? It's silly to say that cTrL alt del, killing the php-cgi process.

Finally, paste the nginx php configuration file, slightly change the port, write a phpinfo page, and run normally.

-----------------------------------------------------------------

Nginx conf:

Server {
Listen 127.0.0.1: 80;
Server_name localhost;

Location /{
Root d:/php /;
}

Location ~ . Php $ {
Fastcgi_pass 127.0.0.1: 521;
Fastcgi_index index. php;
Fastcgi_param SCRIPT_FILENAME d:/php $ fastcgi_script_name;
INcLude fastcgi_params;
}
}

-----------------------------------------------------------------

I decompress php in d: php-5.2.6-win32, put a few more stuff in it:

D: php-5.2.6-win32RunHIdDenConsole.exe

This exe in http://www.box.net/sharEd/Vfvqyjhday can be found here

D: php-5.2.6-win32start_fastcgi

This is an example. first create a shortcut for runhiddenconsole.exe, and then enter the Attribute Modification target

D: php-5.2.6-Win32RunHiddenConsole.exe php-cgi-B 127.0.0.1: 521

Of course, you can also write a bat for the same purpose.

-----------------------------------------------------------------

When using, enable nginx, and then execute d: php-5.2.6-win32start_fastcgi can be, php and nginx other configuration, take care of themselves.

Appendix-How nginx php works:

Nginx uses a proxy-like mode to connect to the fastcgi port. php needs to enable the cgi engine and then listen to the corresponding port. In fastcgi, the coupling between nginx and php is relatively small, therefore, mutual influence will be minimized. Spawn-fcgiand runhiddenconsole.exe are tools used to manage php-cgi in linux and windows respectively. spawn-fcgi can create multiple php-cgi process listening ports. The RunHiddenConsole only hides the cmd window, even if these two tools are not used, php-cgi can be started.

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.