¡¡¡¡¸Õ¿´µ½nginxÕâ¸ö´Ê£¬ÎҺܺÃÆæËüµÄ¶Á·¨£¨engine x£©£¬ÎÒµÄÖ±ÒëÊÇ¡°ÒýÇæx¡±£¬Ò»°ãÒý¡°Çæ´ú¡±±íÁËÐÔÄÜ£¬¶ø¡°x¡±´ó¶à³öÏÖÊDZíʾ¡°xtras£¨¶îÍâµÄЧ¹û£©¡±£¬ÄÇôÕû¸ö´ÊµÄÒâ˼¾ÍÊÇÀàËÆ¡°¼«ÖÂЧ¹û¡±£¬¡°¶îÍâÐÔÄÜ¡±¡£µ±È»ÕâÀï²»ÊÇÒªÀ´ßëྣ¬ÒÔÉÏÊÇÌâÍâ»°¡£
¡¡¡¡nginxÏà½ÏÓÚÎÒÃÇÊìϤµÄapache¡¢IISµÄÓÅÊÆ£¬¾ÍÎÒdzÈëdz³öµÄÁ˽⣬ÔÚÓÚ¡°·´Ïò´úÀí¡±ºÍ¡°¸ºÔؾùºâ¡±¡£Òò´Ë¿¼Âǵ½Äܹ»ÎªWeb·þÎñÆ÷ ½ÚÊ¡×ÊÔ´£¬Ëü¿ÉÒÔ´úÌæapacheÀ´ÌṩWeb·þÎñ¡£ÄÇôÉÏÕýÌâÁË£¬nginxÓÐÕâô¶àÓÅÊÆ£¬ÄÇÔÚwindowsÏÂÈçºÎÀ´ÅäÖÃnginx+php»·¾³£¿Íø ÉÏ¿´µ½»¹ÊÇÄÇô¶àתÔØÀ´×ªÔØÈ¥µÄÎÄÕ¡£ÕâÀï¾ÍÎÒÅäÖõĹý³Ì£¬À´½éÉÜһϣº
1¡¢Ê×ÏÈÐèҪ׼±¸µÄÓ¦ÓóÌÐò°ü¡£
¡¡¡¡nginx£ºnginx/Windows-1.0.4
¡¡¡¡php£ºphp-5.2.16-nts-Win32-VC6-x86.zip £¨nginxÏÂphpÊÇÒÔFastCGIµÄ·½Ê½ÔËÐУ¬ËùÒÔÎÒÃÇÏÂÔØ·ÇḬ̈߳²È«Ò²¾ÍÊÇntsµÄphp°ü£©
¡¡¡¡£¨»¹»áÓõ½£©RunHiddenConsole£ºRunHiddenConsole.zip
2¡¢°²×°ÓëÅäÖá£
¡¡1£©phpµÄ°²×°ÓëÅäÖá£
¡¡¡¡Ö±½Ó½âѹÏÂÔغõÄphp°ü£¬µ½DÅÌwnmpĿ¼£¨D:\wnmp£©£¬ÕâÀï°Ñ½âѹ³öÀ´µÄÎļþ¼ÐÖØÃüÃû³Éphp5¡£½øÈëÎļþ¼ÐÐÞ¸Äphp.ini-recommendedÎļþΪphp.ini£¬²¢ÓÃEditplus»òÕßNotepad++´ò¿ªÀ´¡£ÕÒµ½
extension_dir = "./ext"
¸ü¸ÄΪ
extension_dir = "D:/wnmp/php5/ext"
;extension=php_mysql.dll ;extension=php_mysqli.dll
Ç°ÃæÖ¸¶¨ÁËphpµÄext·¾¶ºó£¬Ö»Òª°ÑÐèÒªµÄÀ©Õ¹°üÇ°ÃæËù¶ÔÓ¦µÄ¡°;¡±È¥µô£¬¾Í¿ÉÒÔÁË¡£ÕâÀï´ò¿ªphp_mysql.dllºÍphp_mysqli.dll£¬ÈÃphpÖ§³Ömysql¡£µ±È»²»ÒªÍüµôºÜÖØÒªµÄÒ»²½¾ÍÊÇ£¬°Ñphp5Ŀ¼ÏµÄlibmysql.dllÎļþ¸´ÖƵ½C:\WindowsĿ¼Ï£¬Ò²¿ÉÒÔÔÚϵͳ±äÁ¿ÀïÃæÖ¸¶¨Â·¾¶£¬µ±È»ÕâÀïÎÒÑ¡ÔñÁ˸üΪ·½±ãµÄ·½·¨^_^¡£
µ½ÕâÀphpÒѾ¿ÉÒÔÖ§³ÖmysqlÁË¡£
¡¡¡¡½ÓÏÂÀ´ÎÒÃÇÀ´ÅäÖÃphp£¬ÈÃphpÄܹ»Óënginx½áºÏ¡£ÕÒµ½
;cgi.fix_pathinfo=1
ÎÒÃÇÈ¥µôÕâÀïµÄ·âºÅ¡£
cgi.fix_pathinfo=1
¡¡2£©nginxµÄ°²×°ÓëÅäÖá£
¡¡¡¡°ÑÏÂÔغõÄnginx-1.0.4µÄ°üͬÑù½âѹµ½DÅ̵ÄwnmpĿ¼Ï£¬²¢ÖØÃüÃûΪnginx¡£½ÓÏÂÀ´£¬ÎÒÃÇÀ´ÅäÖÃnginx£¬ÈÃËüÄܹ»ºÍphpÐͬ¹¤×÷¡£½øÈënginxµÄconfĿ¼£¬´ò¿ªnginxµÄÅäÖÃÎļþnginx.conf£¬ÕÒµ½
location / { root html;¡¡¡¡¡¡¡¡¡¡¡¡#ÕâÀïÊÇÕ¾µãµÄ¸ùĿ¼ index index.html index.htm; }
½«root html;¸ÄΪroot D:/wnmp/www;
ÔÙÍùÏ£¬ÕÒµ½
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #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; #}
ÏȽ«Ç°ÃæµÄ¡°#¡±È¥µô£¬Í¬Ñù½«root html;¸ÄΪroot D:/wnmp/www;¡£Ôٰѱê¼ÇΪºìÉ«µÄ/scripts¸ÄΪ¡°$document_root¡±£¬ÕâÀïµÄ¡°$document_root¡±¾ÍÊÇָǰÃæ¡°root¡±ËùÖ¸µÄÕ¾µã·¾¶£¬ÕâÊǸÄÍêºóµÄ£º
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root D:/wnmp/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; }
±£´æÅäÖÃÎļþ£¬¾Í¿ÉÒÔÁË¡£
¡¡¡¡nginx+phpµÄ»·¾³¾Í³õ²½ÅäÖúÃÁË£¬À´ÅÜÅÜ¿´¡£ÎÒÃÇ¿ÉÒÔÊäÈëÃüÁî
À´Æô¶¯php£¬²¢ÊÖ¶¯Æô¶¯nginx£¬µ±È»Ò²¿ÉÒÔÀûÓýű¾À´ÊµÏÖ¡£
¡¡¡¡Ê×ÏÈ°ÑÏÂÔغõÄRunHiddenConsole.zip°ü½âѹµ½nginxĿ¼ÄÚ£¬RunHiddenConsole.exeµÄ×÷ÓÃÊÇÔÚÖ´ÐÐ ÍêÃüÁîÐнű¾ºó¿ÉÒÔ×Ô¶¯¹Ø±Õ½Å±¾£¬¶ø´Ó½Å±¾ÖпªÆôµÄ½ø³Ì²»±»¹Ø±Õ¡£È»ºóÀ´´´½¨½Å±¾£¬ÃüÃûΪ¡°start_nginx.bat¡±£¬ÎÒÃÇÔÚNotepad++ ÀïÀ´±à¼Ëü
@echo off REM Windows ÏÂÎÞЧ REM set PHP_FCGI_CHILDREN=5 REM ÿ¸ö½ø³Ì´¦ÀíµÄ×î´óÇëÇóÊý£¬»òÉèÖÃΪ Windows »·¾³±äÁ¿ set PHP_FCGI_MAX_REQUESTS=1000 echo Starting PHP FastCGI... RunHiddenConsole D:/wnmp/php5/php-cgi.exe -b 127.0.0.1:9000 -c D:/wnmp/php5/php.ini echo Starting nginx... RunHiddenConsole D:/wnmp/nginx/nginx.exe -p D:/wnmp/nginx
ÔÙÁíÍâ´´½¨Ò»¸öÃûΪstop_nginx.batµÄ½Å±¾ÓÃÀ´¹Ø±Õnginx
@echo off echo Stopping nginx... taskkill /F /IM nginx.exe > nul echo Stopping PHP FastCGI... taskkill /F /IM php-cgi.exe > nulexit
×öºÃºó£¬ÊÇÕâÑùµÄ
ÕâÑù£¬ÎÒÃǵķþÎñ½Å±¾Ò²¶¼´´½¨Íê±ÏÁË¡£Ë«»÷start_nginx.bat¿´¿´½ø³Ì¹ÜÀíÆ÷ÊDz»ÊÇÓÐÁ½¸önginx.exeµÄ½ø³ÌºÍÒ»¸öphp-cgi.exeµÄ½ø³ÌÄØ£¿
ÕâÑùnginx·þÎñ¾ÍÆô¶¯ÁË£¬¶øÇÒphpÒ²ÒÔfastCGIµÄ·½Ê½ÔËÐÐÁË¡£
µ½Õ¾µãĿ¼Ï£¬Ð½¨Ò»¸öphpinfo.phpµÄÎļþ£¬ÔÚÀïÃæ±à¼
<?php phpinfo();?>
±£´æºó£¬´ò¿ªä¯ÀÀÆ÷ÊäÈë¡°http://localhost/phpinfo.php¡±£¬Èç¹û¿´µ½
¾Í˵Ã÷£¬nginx+phpµÄ»·¾³ÒѾÅäÖúÃÁË£¬ºÇºÇ~
ÍƼöÐÅÏ¢
- linuxÃüÁîѧϰ±Ê¼Ç£¨11£©£ºnlÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨5£©£ºrmÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨4£©£ºmkdirÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨1£©£ºlsÃüÁî
- ½«CentosµÄyumÔ´¸ü»»Îª¹úÄڵİ¢ÀïÔÆÔ´
- ʹÓÃNginxÌí¼Óheader·ÀÖ¹ÍøÒ³±»frame
- linuxϼÓËÙscp´«Êä´óÎļþµÄËÙ¶È
- linuxϵͳÉ϶ÔnginxÈÕÖ¾·Ö¸î´¦Àí
- lnmp/nginxϵͳÕæÕýÓÐЧµÄͼƬ·ÀµÁÁ´ÍêÕûÉèÖÃÏê½â
- Í»ÆÆÊ®Íò²¢·¢µÄNginxµÄÅäÖü°ÓÅ»¯
ÈÈÃÅÐÅÏ¢
- nohup: redirecting stderr to stdou....
- ʹÓÃlog_formatΪNginx·þÎñÆ÷ÉèÖøüÏêϸµÄÈÕÖ¾¸ñʽ
- jquery easyUI--dataGrid-Json
- [Ô´´]·ÂGoogle Reader¡¢ÐÂÀË΢²©¡¢ÌÚѶ΢²©µ....
- ÀûÓÃKeepalived+mysql¹¹½¨¸ß¿ÉÓÃMySQLË«Ö÷×Ô¶....
- Nginx+keepalivedʵÏÖ¸ºÔؾùºâºÍË«»úÈȱ¸¸ß¿ÉÓÃ
- jqueryʵÏÖÒ³Ãæ¼ÓÔؽø¶ÈÌõ
- Rolling cURL: PHP²¢·¢×î¼Ñʵ¼ù
- codeigniter ·ÓÉÖÕ¼«ÓÅ»¯(url rewrite)
- linuxÏÂÉèÖÃsshÎÞÃÜÂëµÇ¼
×î½ü¸üÐÂ
- ²éÕÒ²¢É¾³ý.svnĿ¼Îļþ
- redis ÆßÖÖÊý¾ÝÀàÐ͵ÄʹÓó¡¾°
- linux ÏÂÎļþ¸´ÖƵ½windowsÏÂÂÒÂëµÄ½â¾ö°ì·¨
- nginx³öÏÖ502 upstream sent too big he....
- linuxÏÂsudoÅäÖÃÏê½â
- linuxÃüÁîѧϰ±Ê¼Ç£¨15£©£ºtailÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨14£©£ºheadÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨13£©£ºlessÃüÁî
- linuxÃüÁîѧϰ±Ê¼Ç£¨12£©£ºmoreÃüÁî
- ¼ÓÃÜËã·¨±È½Ï3DES AES RSA ECC MD5 SHA1µÈ
ÆÀÂÛ