php??VC9,VC6,Thread Safe,Non Thread SafeµÄÒâ˼???
VC9,VC6,Thread Safe,Non Thread SafeµÄÒâ˼?
ʱ¼ä:2009-10-07 10:55À´Ô´:ÍøÂç ×÷Õß:CNITonline.comÕûÀí ÎÒҪͶ¸å ×¢²áIT¼ÒÔ°
×î½üÔÚPHP¹ÙÍøÉÏ¿´µ½ÓÖÓÐаæµÄPHPÏÂÔØÁË£¬ÓÚÊÇÉÏÈ¥ÕÒÕÒFor WindowsµÄ°æ±¾£¬¿ÉÊÇÒ»¿´È·ÉµÑÛÁË£¬Ò»¹²¸øÁËËĸö°æ±¾£¬VC9 x86 Non Thread Safe¡¢VC9 x86 Thread Safe¡¢VC6 x86 Non Thread Safe¡¢VC6 x86 Thread Safe£¬ÕâÈÃÎÒÕâ¸ö²ËÄñÍ·ÌÛ°¡£¬»¹ºÃ PHP ¹ÙÍøÌṩÏÂÔصĵط½×ó±ßÓиöÓ¢ÎÄ choose ÎÒ¿´¶®ÁË£¬ÎÒ¹ÀÃþמÍÊÇÈçºÎÀ´Ñ¡Ôñ°æ±¾µÄÒâ˼°É£¬ÓÚÊÇ¿ªÊ¼²é×ֵ估ÉÏÍø²éÕÒ£¬ÖÕÓÚ¿´Ã÷°×Á˾ßÌåÒâ˼£¬ÄÃÀ´×ö¸ö±¸ÍüÏÈ¡£
Ò»¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ VC9 °æ±¾ºÍ VC6 °æ±¾
VC6 °æ±¾ÊÇʹÓà Visual Studio 6 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà Apache À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC6 °æ±¾¡£
VC9 °æ±¾ÊÇʹÓà Visual Studio 2008 ±àÒëÆ÷±àÒëµÄ£¬Èç¹ûÄãµÄ PHP ÊÇÓà IIS À´¼ÜÉèµÄ£¬ÄÇÄã¾ÍÑ¡Ôñ VC9 °æ±¾¡£
¶þ¡¢ÈçºÎÑ¡Ôñ PHP5.3 µÄ Thread Safe ºÍ Non Thread Safe °æ±¾
ÏÈ´Ó×ÖÃæÒâ˼ÉÏÀí½â£¬Thread Safe ÊÇḬ̈߳²È«£¬Ö´ÐÐʱ»á½øÐÐỊ̈߳¨Thread£©°²È«¼ì²é£¬ÒÔ·ÀÖ¹ÓÐÐÂÒªÇó¾ÍÆô¶¯ÐÂÏß³ÌµÄ CGI Ö´Ðз½Ê½¶øºÄ¾¡ÏµÍ³×ÊÔ´¡£Non Thread Safe ÊÇ·ÇḬ̈߳²È«£¬ÔÚÖ´ÐÐʱ²»½øÐÐỊ̈߳¨Thread£©°²È«¼ì²é¡£
ÔÙÀ´¿´ PHP µÄÁ½ÖÖÖ´Ðз½Ê½£ºISAPI ºÍ FastCGI¡£
ISAPI Ö´Ðз½Ê½ÊÇÒÔ DLL ¶¯Ì¬¿âµÄÐÎʽʹÓ㬿ÉÒÔÔÚ±»Óû§ÇëÇóºóÖ´ÐУ¬ÔÚ´¦ÀíÍêÒ»¸öÓû§ÇëÇóºó²»»áÂíÉÏÏûʧ£¬ËùÒÔÐèÒª½øÐÐḬ̈߳²È«¼ì²é£¬ÕâÑùÀ´Ìá¸ß³ÌÐòµÄÖ´ÐÐЧÂÊ£¬ËùÒÔÈç¹ûÊÇÒÔ ISAPI À´Ö´ÐÐ PHP£¬½¨ÒéÑ¡Ôñ Thread Safe °æ±¾£»
¶ø FastCGI Ö´Ðз½Ê½ÊÇÒÔµ¥Ò»Ïß³ÌÀ´Ö´ÐвÙ×÷£¬ËùÒÔ²»ÐèÒª½øÐÐÏ̵߳ݲȫ¼ì²é£¬³ýÈ¥Ḭ̈߳²È«¼ì²éµÄ·À»¤·´¶ø¿ÉÒÔÌá¸ßÖ´ÐÐЧÂÊ£¬ËùÒÔ£¬Èç¹ûÊÇÒÔ FastCGI À´Ö´ÐÐ PHP£¬½¨ÒéÑ¡Ôñ Non Thread Safe °æ±¾¡£
¹Ù·½²¢²»½¨ÒéÄ㽫Non Thread Safe Ó¦ÓÃÓÚÉú²ú»·¾³£¬ËùÒÔÎÒÃÇÑ¡ÔñThread Safe °æ±¾µÄPHPÀ´Ê¹Óá£
Ïà¹ØÎĵµ£º
http://www.builder.com.cn/2007/1027/583048.shtml
ÔÚphp3.0ÒÔÉÏ°æ±¾ÖУ¬phpÄÚÖÃÁ˼¸ºõÄ¿Ç°ËùÓеÄÊý¾Ý¿â´¦Àíº¯Êý£¬°üÀ¨Oracle;ÔÚ±¾ÎÄÖÐÎÒÃÇͨ¹ýÒ»¸öʵÀýÀ´½éÉÜÁËÈçºÎʹÓÃÕâЩº¯ÊýÀ´²Ù×÷OracleÊý¾Ý¿â¡£
PHPÌṩÁË2´óÀàAPI(Ó¦ÓóÌÐò½Ó¿Ú)À´²Ù×÷OracleÊý¾Ý¿â¡£Ò»¸öÊDZê×¼µÄOracle´¦Àíº¯Êý(ORA) ÁíÒ»¸öÊÇOracle 8µ÷Óýӿں¯ ......
1. ÈçºÎÓÃphpµÄ»·¾³±äÁ¿µÃµ½Ò»¸öÍøÒ³µØÖ·µÄÄÚÈÝ£¿ipµØÖ·ÓÖÒªÔõÑùµÃµ½£¿
[php]
echo $_SERVER ['PHP_SELF'];
echo $_SERVER ['SERVER_ADDR'];
[/php]
2. ÇóÁ½¸öÈÕÆڵIJîÊý£¬ÀýÈç2007-2-5 ~ 2007-3-6 µÄÈÕÆÚ²îÊý
[php]
$begin=strtotime('2007-2-5');
$end=strtotime('2007-3-6');
echo ($end-$begin)/(24*3600);
[ ......
The define() function defines a constant.
define()º¯ÊýµÄ×÷ÓÃÊÇ£º¶¨ÒåÒ»¸ö³£Á¿¡£
Constants are much like variables, except for the following differences:
³£Á¿[constant]Óë±äÁ¿[variable]ÓкܶàÏàËƵĵط½£¬Òò´Ë£¬ºÜÈÝÒ×»ìÏý£»ÏÂÃ棬ÎÒÃÇÁоÙһϳ£Á¿[constant]Óë±äÁ¿[variable]Ö®¼äµÄ²»Í¬µã£º
A const ......
ÔÚÍùPHP SessionÀïÃæ±£´æÐÅϢ֮ǰ£¬ÐèÒªÊ×ÏÈʹÓÃsession_start()º¯ÊýÀ´Æô¶¯session,
Õâ¸öº¯Êý±ØÐëÔÚ<html>±êǩ֮ǰµ÷ÓᣴúÂëÈçÏ£º
<?php session_start(); ?>
<html>
<body>
</body>
</html>
ÔÚSessionÆô¶¯ÒԺ󣬿ÉÒÔʹÓÃPHP $_SESSION±äÁ¿À´»ñÈ¡ºÍÉèÖÃsession±äÁ¿£¬ÊµÀý´ú ......
¡¾1¡¿Ò³ÃæÖ®¼äÎÞ·¨´«µÝ±äÁ¿ get,post,sessionÔÚ×îеÄphp°æ±¾ÖÐ×Ô¶¯È«¾Ö±äÁ¿Êǹرյģ¬ËùÒÔÒª´ÓÉÏÒ»Ò³ÃæÈ¡µÃÌá
½»¹ýÀ´µÃ±äÁ¿ÒªÊ¹ÓÃ$_GET['foo'],$_POST['foo'],$_SESSION['foo']À´µÃµ½¡£µ±È»Ò²¿ÉÒÔÐÞ¸Ä×Ô¶¯È«¾Ö±äÁ¿Îª¿ª
(php.ini¸ÄΪregister_globals = On)£»¿¼Âǵ½¼æÈÝÐÔ£¬»¹ÊÇÇ¿ÆÈ×Ô¼ºÊìϤеÄд·¨±È½ÏºÃ¡£
¡¡¡¡¡¾2 ......