¹ØÓÚPHPÖеÄ·¾¶ÎÊÌâ
1¡¢Ê¹Óþø¶Ô·¾¶°üº¬Îļþ
ÔÚÿ´Î¶ÔÎļþµÄ°üº¬ÖУ¬¶¼Ê¹ÓÃϵͳ¾ø¶Ô·¾¶½øÐаüº¬£¬±ÈÈç require('/var/www/html/inc/test.inc')£»µÄ·½Ê½£¬ÔÚËùÓÐÎļþÖж¼ÕâÑù°üº¬¾Í¿ÉÒÔ±ÜÃâ¶à¼¶°üº¬³öÏÖµÄÎÊÌ⣬µ«ÊÇÕâÖз½Ê½²»Áé»î£¬ÏµÍ³¿ÉÒÆÖ²ÐÔ¼«²î£¬½¨Òé²»²ÉÓá£
2¡¢ÔÚÒ»¸ö¹«ÓÃÎļþÖж¨Ò幫ÓÃÎļþµÄÁÐ±í£¬½«¸÷¸ö¹«ÓÃÎļþµÄÍêÕû·¾¶¶¨ÒåΪ±äÁ¿»òÕߺ꣬ϵͳÖи÷¸öÎļþ²ÉÓÃÏà¶Ô·¾¶µÄ·½Ê½°üº¬´Ë¹«ÓÃÎļþ£¬È»ºóʹÓñäÁ¿°üº¬ÐèÒª°üº¬µÄÎļþ£¬ÕâÑù¿ÉÒÔʵÏÖͳһά»¤Ò»¸öÎļþ¼´¿É£¬µ«ÊÇÕâÖÖ·½Ê½¸Ð¾õÈÔÈ»²»ÊǺÜˬ£¬ÒÆÖ²ÆðÀ´Ð޸ĵĵط½ÈÔÈ»½Ï¶à¡£
3¡¢½«ËùÓеijÌÐò·Åµ½Ò»¸öĿ¼Ï£¬ÕâÑùËùÓеİüº¬µ÷Óö¼Ê¹Óõ±Ç°Â·¾¶£¬¾Í±ÜÃâÁË·¾¶ÎÊÌ⣬ÕâÖÖ·½Ê½Ôںܶ࿪ԴµÄÂÛ̳³ÌÐòÖн϶à²ÉÓ㬵«ÊÇÕâÑùµÄ½á¹¹¶Ô±È½Ï´óÐͺ͸´ÔÓµÄϵͳӦÓôæÔÚÃ÷ÏԵIJ»×ã¡£
4¡¢ÐÞ¸Äphp.iniÎļþ£¬ÔÚphp.iniÖÐÉèÖà include_pathÏ½«ËùÓеĹ«ÓÃÎļþºÍÐèÒª½øÐе÷Óðüº¬µÄÎļþ·¾¶Ð´½øÕâ¸öÉèÖÃÏîÀÕâÑùÔÚ³ÌÐòÖÐÎÞÂÛµ±Ç°ÎļþÔÚʲô·¾¶£¬¾ù²ÉÓõ±Ç°Â·¾¶µÄ·½Ê½½øÐаüº¬£¬Õâ¸öºÍPHPµÄPEAR°²×°ºÍµ÷Ó÷½Ê½Ò»Ñù£¬ÕâÖз½Ê½ÊµÏÖ¼òµ¥£¬ÒÆÖ²ÐÔÇ¿£¬½¨Òé²ÉÓá£
5¡¢×îºóÒ»ÖÖ·½Ê½£¬Ò²ÊDzÉÓù«ÓÃÎļþ¶¨Òå·¾¶µÄ·½Ê½£¬ÕâÒ²ÊÇÎÒ³£Ê¹Óõķ½Ê½£¬ÔÚÎÒµÄÓ¦ÓÃÖж¨ÒåÒ»¸öpath.phpÎļþ£¬ÔÚÎļþÖж¨Ò嵱ǰӦÓõÄÈ«¾Ö·¾¶±äÁ¿ $ROOT_PATH£¬ËùÓеÄÓ¦ÓÃÎļþ¶¼µ÷ÓúͰüº¬path.phpÎļþ£¬Õâ¸öÎļþ¿ÉÒԷŵ½php.iniµÄinclude_pathÉèÖõÄĿ¼Ï£¬Ò²¿ÉÒԷŵ½ÏµÍ³¸ù /Ï£¬Ò²¿ÉÒԷŵ½Èκεط½£¬Ö»ÒªµÄÏà¶Ô¹Ì¶¨µÄ£¬½¨Òé·Åµ½include_path¶¨ÒåµÄĿ¼Ï£¬path.phpÎļþ¸ù¾Ýµ±Ç°·ÃÎʵÄÒ³ÃæÏà¶ÔµÄPHP_SELFֵȡµÃ·¾¶ÐÅÏ¢£¬È»ºóͨ¹ý¼ÆËãµÄ·½Ê½µÃ³öµ½ÍøÕ¾Ïà¶Ô¸ùĿ¼µÄÏà¶Ô·¾¶£¬ÏÂÃæÊÇÎÒµÄpath.phpÎļþµÄ¼ÆËã$ROOT_PATHÖµµÄ·½Ê½£º
/**
* »ñÈ¡µ±Ç°Îļþָͬ¶¨ÍøÕ¾Ïà¶Ô¸ùĿ¼µÄĿ¼²ãÊý $ROOT_PATH
* $ROOT_PATH ±äÁ¿ÖµÄ©Î²°üº¬ÁË·¾¶µÄ"/"·ûºÅ£¬ÔÚÒýÓÃʱ²»ÒªÔÙ¼Ó"/"
* example: $ROOT_PATH."images/logo.gif"
*/
$_self_path = ($_SERVER['PHP_SELF'] == "" )? $_SERVER['REQUEST_URI'] : $PHP_SELF;
$_path_array = explode("/",$_self_path);
$_path_count = count($_path_array);
$ROOT_PATH = "";
for ($i=0;$i<$_path_count-2;$i++)
{
$ROOT_PATH = '../'.$ROOT_PATH;
}
Õâ¸ö$ROOT_PATH¿ÉÒÔÔÚϵͳÈκεط½Ê¹Óã¬Ö»ÐèÒªÔÚºóÃ
Ïà¹ØÎĵµ£º
±È½ÏPHPºÍJSPÕâÁ½¸öWeb¿ª·¢¼¼Êõ,ÔÚÄ¿Ç°µÄÇé¿öÊÇÆäʵÊDZȽÏPHPºÍJavaµÄWeb¿ª·¢.ÒÔÏÂÊÇÎҾͼ¸¸öÖ÷Òª·½Ãæ½øÐеıȽÏ:
Ò». ÓïÑԱȽÏ
PHPÊǽâÊÍÖ´ÐеķþÎñÆ÷½Å±¾ÓïÑÔ,Ê×ÏÈphpÓмòµ¥ÈÝÒ×ÉÏÊÖµÄÌصã.Óï·¨ºÍcÓïÑԱȽÏÏó,ËùÒÔѧ¹ýcÓïÑԵij ......
LinuxÅäÖÃAPACHE2.2.4 + PHP5.2.1 + MYSQL5.0.37 + GD¿â
µÚÒ»²½£º°²×°RedFlag Linux5.0
°²×°ÏµÍ³Ê±ÇëÎñ±Ø°²×°¿ª·¢¹¤¾ß°üºÍKDE¿ª·¢¹¤¾ß°ü£¬WWW·þÎñÆ÷ºÍSQL·þÎñÆ÷²»Òª°²×°£¬·ñÔò¿ÉÄÜ»á³öÏÖδ֪µÄ´íÎó¡£
µÚ¶þ²½£ºÈ·¶¨linuxϵͳÊÇ·ñ°²×°gcc±àÒëÆ÷
Ê×ÏÈ,GCCÒªÓÐ,²»È»Ê²Ã´¶¼²»ÄÜ×ö.¿ÉÒÔÓÃgcc -vÀ´²é¿´ÊÇ·ñ°²×°ÁËGCC,
#gcc - ......
ÆäʵÕâƪÎÄÕÂÒ²²»ÄÜËã×÷ÊÇÔ´´£¬Ö»ÊÇÔÚÔ×÷ÕߵĻù´¡ÉÏÐ޸ĵıȽ϶࣬¼¸ºõÖØдÁËÒ»±é¡£
<?php
/**
*ÔÚÔ×÷ÕߵĻù´¡ÉÏÐ޸ĵģ¬ºÇºÇ£¬²»¹ýÍü¼ÇÁËÔ×÷ÕßÊÇËÁË£¬
*Èç¹ûÔ×÷Õß¿´µ½µÄ»°£¬¸øÎÒÒ»¸öÌáʾ£¬o(∩_∩)o...
*ÎÒµÄblog:http://etongchina.blogcn.com
*ÎÒµÄÓÊÏä:etongchina@gmail.com
**/
fu ......
Community-IDÊÇÒ»¸öʵÏÖÁË OpenID 2.0 ÐÒéµÄ PHP ¿â¡£
а汾ÔÚÓû§¹ÜÀí½çÃæÔö¼ÓÁËÒ»¸öÇå³ý°´Å¥£¬ÓÃÀ´Çå³ýËÑË÷ÊäÈë¿òµÄÄÚÈݺʹ洢ÔÚµ±Ç°¹ýÂËÆ÷ÁбíµÄÌõ¼þÐÅÏ¢£»¸üÐÂÁËÌáÐÑÓʼþÄ£°åµÄ·ÒëÎı¾£»ä¯ÀÀÓû§ÁбíµÄʱºò½«ÔÚ״̬ÁÐÖÐÏÔʾÉÐδ¼¤»îµÄÓû§Êý£»Zend¿ò¼ÜÉý¼¶µ½ 1.9.2 °æ±¾£»ÐÞÕýÁËһЩbug¡£
ÏÂÔØ Community-ID 1.1.0 ......
PHP»ñȡʱ¼ä´íÎóµÄÐÞÕý·½·¨
½ñÌìÔËÐÐPHP³ÌÐòµÄʱºò£¬ºÜÆæ¹Ö£¬ÎªÊ²Ã´PHP»ñÈ¡µÄʱ¼ä±Èʵ¼Êʱ¼äÕûÕûÉÙÁË8Сʱ£¬ÒÔǰҲûעÒâÕâ¸öÎÊÌ⣬×ÜÒÔΪÊÇʱ¼äÏÔʾ´íÁË£¬ÊÇ°²×°Èí¼þµÄÎÊÌ⣬½ñÌìÔÚÍøÉϲéÁËÏÂ×ÊÁÏ£¬ÔÀ´ÁíÓÐÔÒò¡£
ÆäʵÕâºÍʱÇøÓйأ¬PHPĬÈÏ»ñÈ¡0ʱÇø¿ªÊ¼µÄʱ¼ä£¬ÖйúÔÚ¶«°ËÇø£¬Òò´Ë£¬ÎÒÃÇÖÐ ......