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

phpÈý°å¸«——ÇëÇóºÍ»á»°

 phpÊÇÒ»Ãżòµ¥¶øÓÖÇ¿´óµÄÓïÑÔ£¬ËùÓеÄphpÊé¼®¶¼»áÕâÑù˵£¨Ë­ÈÃÎÒ×î°®¿´Ç°ÑÔÄØ£©¡£Èç¹û½«.net¡¢jsp±È×÷µ¶½££¬ÄÇôphp¾ÍÊǸ«Í·¡£Ñ§»á³ÌÒ§½ðµÄÈý°å¸«£¬Ëä²»ÄÜÌìÏÂÎ޵У¬È´¿ÉÒÔ°²ÉíÁ¢Ãü¡£
½ñÌìÔÛÃÇѧϰµÚÒ»°å¸«£¬ÍøÕ¾½»»¥µÄ»ù´¡£ºÇëÇóºÍ»á»°¡£
PHPÖпͻ§¶ËÓë·þÎñÆ÷ÐÅÏ¢µÄ´«µÝÊÇÒÀ¿¿ÇëÇóÓ¦´ðºÍ»á»°±£³ÖʵÏֵģ¬¶øPHP¶ÔÓÚÇëÇóÓ¦´ðºÍ»á»°Ö÷ҪʹÓÃÄÚÖñäÁ¿Íê³ÉµÄ¡£
´ÓÍøÕ¾±à³ÌµÄ½Ç¶È½²£¬ÇëÇóÊÇÖ¸ä¯ÀÀÆ÷Ïò·þÎñÆ÷·¢Ë͵ÄÇëÇóÐÅÏ¢£¬ÓÃÓÚ»ñµÃÏëÒªµÃµ½µÄÍøÒ³£»¶øÓ¦´ðÊÇÖ¸·þÎñÆ÷¸ù¾ÝÇëÇóÐÅÏ¢£¬·µ»ØÍêÕûÍøÒ³µÄ¹ý³Ì¡£
ÇëÇóºÍÓ¦´ð
ÇëÇóµÄ·½Ê½¿ÉÒÔ·ÖΪPOSTºÍGET£ºGETÊÇָͨ¹ýURL´«µÝµÄÊý¾Ý£¬POSTÊÇָͨ¹ý·ÇURL´«µÝµÄÊý¾Ý¡£Í¨³££¬ÎÒÃÇͨ¹ýµØÖ·À¸ÊäÈëÍøÒ³µØÖ·µÄ·½Ê½ÊÇÓÃGET·½Ê½Ìá½»µÄ£¬¶øÌîд±íµ¥²¢Ìá½»·þÎñÆ÷ÊÇPOST·½·¨¡£
ÎÞÂÛÊÇPOSTºÍGET£¬¶ÔÓÚÒ»¸öÍêÕûµÄÇëÇóÓ¦´ð°üº¬µÄÐÅÏ¢£¬ÓÐÒÔÏÂÁ½¸ö·½Ãæ¹¹³É£º
1¡¢header£¬¼´ÇëÇóµÄÍ·ÐÅÏ¢£º
    ä¯ÀÀÆ÷·¢Ë͵ÄheaderÖ÷Òª°üÀ¨Host(·¢ËÍÇëÇóµÄ¿Í»§¶ËIPµØÖ·)¡¢User-Agent(ͨ³£Îªä¯ÀÀÆ÷µÄ°æ±¾)¡¢Referer(·¢ËÍÇëÇóµÄÉÏÒ»¸öÒ³Ã棬ÓÃÓÚÅжϿͻ§¶Ë´ÓÄĸöÍøÒ³¹ýÀ´µÄ)¡¢Cookie(¿Í»§¶ËµÄCookieÄÚÈÝ)µÈ¡£
    ·þÎñÆ÷·¢Ë͵Äheader°üÀ¨Status(·þÎñÆ÷·µ»ØÍøҳ״̬)¡¢Location(Öض¨ÏòÍøÖ·)¡¢Set-Cookie(ÉèÖÿͻ§¶ËCookie)¡¢Content-Type(×Ö·û±àÂë)¡¢Date(ʱ¼ä)µÈ¡£
2¡¢ä¯ÀÀÆ÷POSTºÍGETÌá½»µÄÊý¾Ý£º
Query String£¬ÕâÊÇÏà¶ÔÓÚGET·½Ê½¶øÑԵġ£µØÖ·À¸Öд«µÝµÄÇëÇó±äÁ¿£¬±ÈÈ磺http://url/index.php?a=3&b=4 £¬ÇëÇó±äÁ¿ÎªaºÍb£¬ËûÃǵÄÖµ·Ö±ðΪ3ºÍ4¡£¿ÉÒÔ¿´³ö£¬ÇëÇó±äÁ¿Î»ÓÚ"?"ºó£¬¸÷¸ö±äÁ¿ÓÃ"&"Á¬½Ó¡£
POST Data£¬ÕâÊÇÏà¶ÔÓÚPOST·½Ê½¶øÑԵġ£SESSIONµÄIDֵĬÈÏÊÇͨ¹ýPOST´«µÝµÄ£¬ÁíÍ⻹ÓÐ±íµ¥Ìá½»µÄPOSTÊý¾Ý¡£
ÈÃÎÒÃÇ¿´Ò»ÏÂPHPÊÇÔõÑù¶ÔÊý¾Ý½øÐнÓÊպͷ¢Ë͵ģº
Ò»¡¢header(httpÍ·)£º
phpÊä³öheaderÐÅÏ¢£º
ʹÓÃHeader()º¯Êý£¬±ÈÈ磺Header("Location: url");
×¢Ò⣬Header()±ØÐëÔÚûÓÐÈκÎÒ³ÃæÊä³öµÄÇé¿öϵ÷Óá£
php½ÓÊÕä¯ÀÀÆ÷header£º
$SERVER[]ÄÚÖñäÁ¿¼Ç¼ÁË·þÎñÆ÷±£´æµÄÐÅÏ¢£¬ä¯ÀÀÆ÷Ìá½»µÄheaderÒ²°üÀ¨ÔÚÄÚ£º
$SERVER["PHP_SELF"]Ö¸±¾ÍøÒ³£»$SERVER["REQUEST_TIME"]ΪDate£»$SERVER["REQUEST_METHOD"]ΪÇëÇó·½·¨(GET»òPOST)£»$SERVER["HTTP_HOST"]Ϊhost£»$SERVER["HTTP_REFERER"]ΪRerfer£¬ÆäËûµÄÇë²ÎÕÕPHPÎĵµÖÐ$SERVER[]µÄ½éÉÜ¡£
±ÈÈ磬ҪÏëµÃµ½·ÃÎÊÍøÕ¾µÄ¿Í»§¶Ëip£¬¿ÉÒÔÕâÑùд£º


Ïà¹ØÎĵµ£º

1·ÖÖÓÍêÃÀ°²×°×îРCentOS + Nginx + PHP FPM + MySQL


PHP 5.3.1
MySQL 5.0.89
Nginx 0.8.33 »ò 0.7.65 £¨¿ÉÑ¡£©
ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔ¿ìËÙÈ«×Ô¶¯¸ã¶¨ CentOS + Nginx + PHP-FPM + MySQL µÄ°²×°ÁË
Õâ¸ö¿É±ÈÍøÉÏÁ÷´«µÄʲôһ¼ü°²×°°üÒªºÃµÃ¶à£¬Ç¿ÁÒÍƼö´Ë·¨°²×°£¬ÊʺÏËùÓвËÄñºÍ¸ßÊÖ
ÎÒ·þÎñÆ÷ÉÏÈ«ÓõÄÔ´ ......

LinuxÏÂApache 2.2, MySQL 5.0ºÍPHP 5.0µÄ°²×°ÓëÅäÖÃ

¡¾×ª¡¿http://www.linuxsir.org/main/?q=node/241
1.°²×°»·¾³
²Ù×÷ϵͳ£ºRed Hat Linux Enterprise AS 4.0
Êý¾Ý¿â£ºMySQL 5.0.24
Web·þÎñÆ÷£ºApache 2.2.3
½Å±¾ÓïÑÔ£ºPHP 5.1.6
2.°²×°MySQL 5.0.24
-------------ÏÂÔØÈí¼þ°ümysql-5.0.24.tar.gz£¬µØÖ·http://www.mysql.com-------------
# tar zvxf mysql-5.0.24.ta ......

PHPÈýÖÖ³£Óÿò¼ÜZend¡¢symfony ºÍ CakePHP

Ä£ÐÍ¿ò¼Ü
¿ò¼Ü˼Ïë¾ÍÊÇÌṩһÖÖ¿ÉÒÔÔÚ¶à¸öÓ¦ÓóÌÐòÖÐʹÓõÄÉè¼Æ¡£ËùÓÐÓ¦ÓóÌÐò¶¼ÓдóÁ¿Í¨ÓõĻù±¾ÄÚÈÝ —— ¾ßÌåµØ˵£¬¾ÍÊÇijÀàÓëÊý¾Ý¿âµÄ½Ó¿Ú¡¢Ä³Ð©Ó¦ÓóÌÐòÂß¼­¡¢Ó¦ÓóÌÐò³ÊÏÖ¸øÓû§µÄÄÚÈݵȡ£Èç¹ûÄú±àд¹ýÐí¶à PHP Ó¦ÓóÌÐò£¬Ôò»áÖªµÀÕâЩ»ù±¾ÄÚÈÝÊÇʲô¡£Äú¿ÉÄÜÒѾ­±àд¹ýÒ»×麯Êý»ò´ÓÊý¾Ý¿âÖжÁÈ¡Êý¾ÝºÍÏòÊ ......

PHP Îļþ¶Áд²Ù×÷

 ¡¡¡¡PHP ÖУ¬Êý¾Ýͨ³£¶¼ÊÇ´æ´¢ÔÚMySQLÊý¾Ý¿âµ±Öеġ£µ«ÊÇÓÐЩʱºò£¬ÎÒÃÇ»¹ÊÇÐèҪʹÓÃPHP¶ÁдһЩ±¾µØÎļþ¡£±ÈÈçÉú³É¾²Ì¬Ò³Ãæ»òÕßÊý¾ÝµÄ±¾µØ»º´æ¡£
 ¡¡¡¡PHP5+ ÌṩÁËÒ»ÖÖ·½·¨ file_put_contents(file,data,mode,context)£¬Ëü½«Ò»¸ö×Ö·û´®Ð´ÈëÎļþ£¬·µ»ØдÈëµ½ÎļþÄÚÊý¾ÝµÄ×Ö½ÚÊý¡£ºÍÒÀ´Îµ÷Óà fopen()£¬fwr ......

±àÒë°²×°spawn fcgi£¨nginxͨ¹ýFastCGI·½Ê½µ÷ÓÃPHP£©

ÅäÖÃspawn-fcgiÆô¶¯
²ÎÊý˵Ã÷:
-f Ö¸¶¨µ÷ÓÃFastCGIµÄ½ø³ÌµÄÖ´ÐгÌÐòλÖ㬸ù¾ÝϵͳÉÏËù×°µÄPHPµÄÇé¿ö¾ßÌåÉèÖÃ
-a °ó¶¨µ½µØÖ·addr
-p °ó¶¨µ½¶Ë¿Úport
-s °ó¶¨µ½unix socketµÄ·¾¶path
-C Ö¸¶¨²úÉúµÄFastCGIµÄ½ø³ÌÊý£¬Ä¬ÈÏΪ5£¨½öÓÃÓÚPHP£©
-P Ö¸¶¨²úÉúµÄ½ø³ÌµÄPIDÎļþ·¾¶
-uºÍ-g FastCGIʹÓÃʲôÉí·Ý£¨-u Óû§ -g Ó ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ