Introduction: This is the PHP + nginx installation of the detailed page, introduced and php,php, Nginx, CGI, fastcgi PHP + nginx installation related knowledge, skills, experience, and some PHP source code and so on.
class= ' pingjiaf ' frameborder= ' 0 ' src= ' http://biancheng.dnbcw.info/pingjia.php?id=357337 ' scrolling= ' no ' >
Today try to run PHP under the WIN2K3 system with Nginx server.
Why use Nginx?
Compact and free to install.
Why are you fastcgi?
Nginx if PHP does not use the FASTCGI mode will be used in the proxy mode as well as the configuration of Apache and other problems.
Go directly to Http://windows.php.net/download to download a PHP Zip package
There are four different types of versions, VC9 x86 Non thread safe, VC9 x86 thread safe, VC6 x86 Non thread safe, VC6 x86 thread safe How to choose?
I. How to select the VC9 version and the VC6 version of PHP5.3
The VC6 version is compiled with the visual Studio 6 compiler, and if your PHP is built with Apache, you choose the VC6 version.
The VC9 version is compiled with the visual Studio 2008 compiler, and if your PHP is built with IIS, you choose the VC9 version.
Second, how to choose the PHP5.3 thread safe and non thread safe version
First of all, in the literal sense, thread safe is threaded and thread security is performed to prevent new requirements from starting
The CGI execution of the new thread runs out of system resources. Non thread safe is non-threaded and does not thread (thread) security checks at execution time.
Let's look at two ways of executing PHP: ISAPI and fastcgi.
ISAPI execution mode is used in the form of DLL dynamic library, can be executed after the user request, after processing a user request will not disappear immediately, so the need for thread security check, so as to improve the execution efficiency of the program, so if it is to execute PHP with ISAPI, it is recommended to choose thread Safe version;
The fastcgi execution is performed with a single thread, so there is no need for thread security checks, and the removal of thread safety checks can improve execution efficiency, so if PHP is executed in fastcgi, it is recommended to choose the non thread safe version.
Because I have VC9 library on my computer and I want to run php-fastcgi with Nginx, so I VC9 x86 Non Thread safe version of zip-free version
Note: If not installed, please go to Microsoft to download the Microsoft Visual C + + SP1 Redistributable Package (x86) installation!
Install PHP:
1, unzip php-5.3.0-nts-win32-vc9-x86.zip to D:\php;
2, copy D:\php\php.ini-development and rename to D:\php\php.ini
3, Notepad edit D:\php\php.ini
1) Set the system default time zone for China
Find; date.timezone =
to Date.timezone =PRC
2) Set Expansion pack directory
Find; Extension_dir = "ext"
changed to Extension_dir = "ext"
3) to open GD2, MySQL and other expansion packs
find separately; Extension=php_gd2.dll and Extension=php_ Mysql.dll
Remove the front; you can
4) create a new Notepad file under D:\php
Content php-cgi.exe-b 127.0.0.1:9000-c php.ini
Rename or Save as Startup.bat
Installing Nginx
1, to http://sysoev.ru/nginx/download.html download Nginx latest version of Windows Nginx/windows-0.8.21.zip
2, decompression nginx-0.8.21.zip to D:\
3. Open D:\nginx-0.8.21\conf\nginx.conf with Notepad
4. Find #location ~ \.php$ {
Will
#location ~ \.php$ {
# root HTML;
# Fastcgi_pass 127.0.0.1:9000;
# Fastcgi_index index.php;
# Fastcgi_param Script_filename/scripts$fastcgi_script_name;
# include Fastcgi_params;
#}
Switch
Location ~ \.php$ {
root HTML;
Fastcgi_pass 127.0.0.1:9000;
Fastcgi_index index.php;
Fastcgi_param script_filename $document _root$fastcgi_script_name;
Include Fastcgi_params;
}
5. Find Location/{
Place location/{
root HTML;
Index index.html index.htm;
}
Change to location/{
root HTML;
Index index.html index.htm index.php;
}
Save and close nginx.conf
=============== I am the dividing line of legend =============
Start the service:
Enter D:\php\ to perform startup.bat start php_fastcgi
Enter D:\nginx-0.8.21 Open Nginx.exe
Open the process Manager to see that there are two nginx.exe in the process, a php-cgi.exe process that indicates a successful start
Explore http://localhost/
Open Folder D:\nginx-0.8.21\html
Delete the index.html inside and create the new index.php content as
Refresh http://localhost/
This is a pure green installation if you want the service to run automatically every time you turn it on, add it yourself as a system service.
Reprinted from: http://hi.baidu.com/eisn/blog/item/74ce78894b518ab90f24446a.html
Love EE focus on Java Michael Jackson Video station JSON online tool
Http://biancheng.dnbcw.info/php/357337.html Pageno:2