Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ʹÓÃnginxÅäÖöà¸öphp fastcgi¸ºÔؾùºâ

ÅäÖû¹ÊǷdz£¼òµ¥µÄ£¬³ä·ÖÌåÏÖÁËnginxµÄÇ¿´óÓëÅäÖõļòµ¥^^ÏÂÃæÊÇ´óÖµķþÎñÆ÷½á¹¹Í¼£º
Ó¦ÓõÄ×îÇ°¶ËÊÇһ̨nginx·þÎñÆ÷£¬ËùÓо²Ì¬µÄÄÚÈݶ¼ÓÉnginxÀ´´¦Àí£¬¶ø½«ËùÓÐphpµÄÇëÇ󶼷Ö̯µ½ÏÂÓεÄÈô¸Ę́ÔËÐÐphp fastcgiÊØ»¤½ø³ÌµÄ·þÎñÆ÷ÖУ¬ÕâÑù¿ÉÒÔÒÔÒ»ÖÖÁ®¼ÛµÄ·½°¸À´ÊµÏÖ¶Ôϵͳ¸ºÔصķÖ̯£¬À©Õ¹ÏµÍ³µÄ¸ºÔØÄÜÁ¦¡£
Èý̨php fastcgi·þÎñÆ÷µÄipµØÖ··Ö±ðΪ£º
172.16.236.110 , 172.16.236.111, 172.16.236.112
ÔËÐÐphp fastcgi½ø³Ìʱ£¬ÐèÒªÈÃphp-cgi¼àÌýµ½·þÎñÆ÷µÄ¾ÖÓòÍøµØÖ·£¨·Ö±ðÈçÉÏËùʾ£©£¬¶ø²»ÊÇ֮ǰһ°ã¶¼ÊǼàÌýµÄ±¾µØµØÖ·£¨127.0.0.1£©¡£ÒÔ172.16.236.110Õą̂·þÎñÆ÷ΪÀý£º
1
/usr/local/php5/bin/php-cgi -b 172.16.236.110:9000
»òÐíÄãÓÃspawn-fcgiÀ´Æô¶¯php-fcgi£¬ÄÇô¾ÍÊÇÕâÑù£¨¹©²Î¿¼£¬ÆäʵҲ¾ÍÊÇÐ޸ļàÌýµÄµØÖ·ºÍ¶Ë¿Ú¼´¿É£©£º
1
/usr/local/lighttpd/bin/spawn-fcgi -f /usr/local/php5/bin/php-cgi -a 172.16.236.110 -p 9000
ÓÖ»òÐíÄãÊÇÓÃphp-fpmÀ´¹ÜÀíphp-fcgi£¬ÄÇôÄãÐèÒªÐÞ¸Äphp-fpmµÄÅäÖãº
1
vi /usr/local/php5/etc/php-fpm.conf
ÕÒµ½Õâ¸öÅäÖÃÏÆäÖеĵØÖ·¿ÉÄÜÐèÒª¸ù¾ÝÄã×Ô¼º»·¾³À´µ÷Õû£©
<value name="listen_address">127.0.0.1:9000</value>
ÐÞ¸ÄΪ£º<value name="listen_address">127.0.0.1:9000</value>
ÐÞ¸ÄÍê±Ïºó£¬ÖØÆôÄãµÄphp-fpm½ø³Ì¡£
È»ºó°´ÕÕÉÏÃæµÄ²½Ö裬ÒÀ´ÎÐÞ¸ÄÆäËûphp fastcgi·þÎñÆ÷¡£
php·½ÃæµÄ¹¤×÷ÔÝʱ¾ÍÊÇÕâЩ£¬ÏÂÃæÐÞ¸Änginx¡£
1
vi /usr/local/nginx/conf/nginx.conf
ÔÚÅäÖÃÎļþµÄhttp¶ÎÄÚÔö¼ÓÀàËÆÈçϵÄÅäÖãº
1
2
3
4
5
upstream myfastcgi {
server 172.16.236.110 weight=1;
server 172.16.236.111 weight=1;
server 172.16.236.112 weight=1;
}
ÎÒÕâÀïÈý̨php fastcgi·þÎñÆ÷µÄȨÖØÊÇÏàͬµÄ£¬ËùÒÔÆäÖеÄweightÖµ¶¼ÊÇ1£¬Èç¹ûÄãµÄphp fastcgi·þÎñÆ÷ÐèÒª·ÖÖ÷´Î£¬ÄÇô¿ÉÒÔͨ¹ýµ÷ÕûÆäweightÖµÀ´´ïµ½Ä¿µÄ¡£±ÈÈçÒÔµÚһ̨·þÎñÆ÷ΪÖ÷£¬ÆäËûÁ½Ì¨Îª¸¨£¬Ôò¾ÍÊÇÕâÑù£º
1
2
3
4
5
upstream myfastcgi {
server 172.16.236.110 weight=1;
server 172.16.236.111 weight=2;
server 172.16.236.112 weight=2;
}
È»ºóÕÒµ½Ô­À´nginx¹ØÓÚphp fastcgiÅäÖõIJ¿·Ö£¬±ÈÈ磺
1
2
3
4
5
6
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
includ


Ïà¹ØÎĵµ£º

ʹÓÃPHPÅúÁ¿Éú³ÉËæ»úÓû§Ãû

Éú³É6 ~ 16λµÄÓû§ÃûÈô¸É¸ö£¬Ö÷ÒªÊÇÎı¾²Ù×÷£¬µ«ÊÇÇ°ÌáÊÇÒªÓÐÒ»¸ö×Ö·û´®°ü¡£Ö÷Òª°üº¬Èý¸ö³ÌÐò¡£
³ÌÐòÒ»£º¸ºÔð´Ó×ÖµäÖÐËæ»úÌáÈ¡Êý¾Ý£¬Ð´ÈëÒ»¸öÐÂÎļþ¡££¨1.php£©
<?php
/* ´Ó×ÖµäÎļþÖÐÌáÈ¡Ëæ»úÖµ */
$file1 = "./Words.dic";
$file2 = "./common_pass_mini.dic";
$file3 = "./Sys_Month_Date.Dic";
$rfile = "./ ......

phpÒÔrootȨÏÞÖ´ÐеĽâ¾ö·½°¸Ö®Ò»

ÕâÖÖÎÊÌâÎÒÏë´ó¼Ò¿ÉÄܶ¼Óöµ½¹ý£¬ÍøÓÑÌṩµÄ½â¾ö·½·¨Ò²ºÜ¶à¡£ÎÒÒ²Ö»ÊǽáºÏ×Ô¼ºÏµÍ³µÄÐèÇó²¢½áºÏÍøÓѵĽâ¾ö·½°¸À´×ܽáµÄÒ»ÖÖ·½·¨
ÓÃÀ´×÷Ϊ½â¾öphpÒÔrootȨÏÞÖ´ÐÐһЩÆÕͨÓû§²»ÄÜÖ´ÐеÄÃüÁî»òÓ¦ÓõIJο¼¡£
ÆäʵphpÀïµÄpopen()º¯ÊýÊÇ¿ÉÒÔ½â¾öÕâ¸öÎÊÌâµÄ£¬µ«ÊÇÓÉÓÚijЩ°æ±¾µÄlinux(ÈçÎÒʹÓõÄCentos 5)¶Ôϵͳ°²È«µÄ¿¼ÂÇ£¬
ʹ ......

ͶÈëµÄphpµÄ»³±§

 Ô­À´ÊÇѧjspµÄ£¬µ«ÊǸоõjspÌ«ÄÑÁË£¬¶øÇÒ·¢ÏÖ£¬ÏÖÔڱȽÏÁ÷ÐÐphpÁË£¬php+mysqlµÄ»Æ½ð´îµµ¡£
 ¿´jspµÄÊéʱ£¬ÊéÉÏ˵£¬jsp±ÈphpºÃ£¬ÏÖÔÚ¿´phpµÄÊ飬˵php±ÈjspºÃ£¬ÎÒÏëÕâÒ²ÊÇÖÇÕß¼ûÖÇ£¬ÈÊÕß¼ûÈÊ°É¡£
 ÇìÐÒ×Ô¼ºÑ§php·¢ÏÖÁËÒ»±¾ºÃÊ飬ÍƼö¸ø´ó¼Ò£¬¾ÍÊǽ²µÄºÜÏêϸ¡£
 Ó¢ÎÄÃû¡¶PHP and MySQL EXAMPLE¡· ÃÀ¹ ......

Yii PHP FrameworkʵÓÃÈëÃŽ̳Ì(ת)

 ×÷Õߣºhttp://blog.csdn.net/zhoufoxcn/archive/2009/11/05/4769858.aspx
˵Ã÷£ºÒòΪ×î½ü¹¤×÷¹¤×÷¹Øϵ£¬ÐèÒª¿ª·¢Ò»¸öÔÚLinuxÏÂÔËÐеÄWeb
Application£¬ÐèÒª¶ÔÏÖÔڱȽÏÁ÷ÐеÄһЩPHP¿ò¼Ü×öÒ»¸öÁ˽âºÍÆÀ¹À£¬ÏÂÃæµÄÕâƪÎÄÕÂÊDZÊÕß×î½üѧϰһ¸ö±È½ÏеÄPHP
FrameworkµÄÒ»µã¾­ÀúºÍ²Ù×÷²½Ö裬ÒòΪ¹Ù·½µÄÊÖ²áдµÃ±È½Ï»Þ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ