PHP·¾¶ÎÊÌâ
<?
php define('__TYPECHO_ROOT_DIR__', dirname(__FILE__));
define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins');
@set_include_path(get_include_path() . PATH_SEPARATOR . __TYPECHO_ROOT_DIR__ . '/var' . PATH_SEPARATOR . __TYPECHO_ROOT_DIR__ . __TYPECHO_PLUGIN_DIR__);
ÄÜÏêϸµÄ½âÊÍÕâ¸öº¯ÊýÂ𣿵±È»ÎÒ²é¹ýÊÖ²áÓ뺯Êý´óÈ«£¬»¹ÓÐÒÔÉϵIJÎÊýÒÔ¼°Õû¾äµÄÒâ˼
ÎÊÌâ²¹³ä£º
ÆäʵÎÒµÄÎÊÌâ¾ÍÊDz»Ã÷°×ΪʲôÓÐÁËget_include_path()£¬Ã»ÒâÒåµÄ°¡£¬°Ñphp.iniÀïÉèÖõÄ·¾¶¶Á³öÀ´ÓÖûʲôÒâÒ壬ÆäËûÎÒ¶¼¶®£¬Å¶£¬»¹ÓÐÏñµÚ¶þ¸ö²ÎÊýµÄ½á¹ûÊÇD:\appserv\www\build/var£¬Ò»¸öÊÇб¸Ü£¬Ò»¸öÊÇ·´Ð±¸ÜÔõôÐÐÄØ,·¾¶»¹²»³ö´í°¡£¿
×î¼Ñ´ð°¸£º
Ê×ÏÈ ÎÒÃÇÀ´¿´Õâ¸öÈ«¾Ö±äÁ¿£º__FILE__ Ëü±íʾÎļþµÄÍêÕû·¾¶£¨µ±È»°üÀ¨ÎļþÃûÔÚÄÚ£© Ò²¾ÍÊÇ˵Ëü¸ù¾ÝÄãÎļþËùÔÚµÄĿ¼²»Í¬£¬ÓÐ×Ų»Í¬µÄÖµ£»µ±È»£¬µ±ËüÓÃÔÚ°üÐÐÎļþÖеÄʱºò£¬ËüµÄÖµÊÇ°üº¬µÄ·¾¶£»
È»ºó£º ÎÒÃÇ¿´Õâ¸öº¯Êý£º string dirname ( string path ) ËüÊÇPHPÄÚÖú¯Êý£¬ËüµÄ×÷ÓÃÊÇʲôÄØ£¬¾ÍÊÇ·µ»Ø³ýÁ˱¾ÎļþÃûÒÔÍâµÄËùÔÚĿ¼£¬¸øÄã¾Ù¸öÀý×Ó ¼ÙÈçÄãµÄÊ×Ò³ÖÐÓõ½ÁË_FILE_Õâ¸ö±äÁ¿£º £¨¼ÙÉèÄãµÄÍøÒ³ËùÔÚĿ¼Ϊ£ºhttp://localhost/web/index.php£©,ÄÇô£º _FILE_µÄֵΪhttp://localhost/web/index.php£¨Ò»¸ö¾ø¶Ô·¾¶£©¡£¶ø´Ëʱdirname (_FILE_)±íʾµÄ¾ÍÊÇhttp://localhost/web/Ò²¾ÍÊÇûÓÐindex.phpÕâ¸öÎļþÃû¡£ ¶ødirname(dirname(_FILE_))±íʾµÄ¾ÍÊÇÉÏÒ»¼¶µÄĿ¼£¬ÒÔ´ËÀàÍÆ£»
×îºó ¿´Ò»ÏÂdefine()Õâ¸öº¯Êý£¬ÆäʵËû¾ÍÊÇÒ»¸ö¶¨Òå³£Á¿µÄº¯Êý£¬±ÈÈ磺define('MEN','ooooo'); ÄÇôÄãºóÄã¾Í¿ÉÒÔÓÃMENÀ´±íʾoooooÕâ¸ö×Ö·û´®£» Èç¹ûÄãѧ¹ýCÓïÑÔ£¬Äã¾ÍºÜÇå³þ,ÆäÖÐÒ²ÓÐÒ»¸öÀàËƵÄ#define MEN "ooooo";£¨ÆäʵӦ¸Ã˵ŶphpºÍCÀàËÆ£¬ÒòΪphp¾ÍÊÇc±àдµÄ£©£» ÄÇôÕâôдÓÐʲôºÃ´¦ÄØ£¬ÄǾÍÊǵ±ÄãÐèÒªÐ޸ıäÁ¿µÄʱºò£¬ÄãÖ»ÒªÐÞ¸ÄËü¾ÍÐÐÁË£¬Ï൱µÄ·½±ã£¬ÓÈÆäÊÇÏñ·¾¶ÕâÑùµÄ×Ö·û´®£¡×îºó¸øÄã½âÊÍÒ»ÏÂÄãÕâ¶Î´úÂ룺 define('__TYPECHO_ROOT_DIR__', dirname(__FILE__)); ¾ÍÊǶ¨Òå__TYPECHO_ROOT_DIR__ΪÕâ¸öÎļþËùÔÚµÄĿ¼£¬ÏñÕâÖÖ¶¨ÒåÒ»°ãÊÇ·ÅÔÚconfig.inc.phpÖеģ¬ÄÇô»ñÈ¡µÄĿ¼Ҳ¾ÍÊÇconfig.inc.phpËùÔÚµÄĿ¼£»Ò²¾ÍÊǸùĿ¼£¡ define('__TYPECHO_PLUGIN_DIR__', '/usr/plugins'); Õâ¾Í²»ÒªÎÒ˵ÁË°É£¡ ÖÁÓÚset_include_path(get_include_path() . PATH_SEPARATOR . $path);ÊÇʲôÒâ˼£¬ÎÒÏëûÓÐÄãÏëµÃÄÇô¸´ÔÓ£
Ïà¹ØÎĵµ£º
ÔÚcentos5.3Ï°²×°GCCËù±ØÐëµÄ5¸öÒÀÀµ°ü
×îС»¯°²×°centos5.3£¬Ä¬ÈÏûÓа²×°gcc,ÀûÓÃÏÂÔصݲװDVD£¬Í¨¹ýfilezillaÉÏ´«£¬·¢ÏÖGCCËù±ØÐëµÄ5¸öÒÀÀµ°üΪ£º
kernel-headers-2.6.18-128.el5.i386.rpm
cpp-4.1.2-44.el5.i386.rpm
libgomp-4.3.2-7.el5.i386.rpm   ......
´Ó¼Ü¹¹Éè¼Æ·½Ã濼ÂÇ£¬ºÜ¶àϵͳ²ÉÓÃÁË Java Bridge°ÑphpºÍJAVA¼¼Êõ½áºÏÆðÀ´£¬ÀûÓÃPHPµÄ¿ìËÙÏìÓ¦ºÍJAVAµÄÊý¾Ý³Ö¾Ã»¯ÄÜÁ¦£¬Äܴܺó³Ì¶ÈÉÏÄÜÌá¸ßϵͳÐÔÄÜ¡£ÕâÁ½ÆªÎÄÕ½«ÏêϸµÄ½éÉÜProject Zero¡¢WebSphere sMash ºÍ PHP µÄÕûºÏ¼¼Êõ
Project Zero¡¢WebSphere sMash ºÍ PHP ÈëÃÅ
http://www.ibm.com/developerworks/cn/web/wa- ......
жÔØMysql
[root@localhost ~]# rpm -qa | grep mysql
mysql-3.23.58-9
php-mysql-4.3.4-11
mod_auth_mysql-20030510-4.1
mysql-server-3.23.58-9
˵Ã÷£ºrpm –qa | grep mysql ÃüÁîÊÇΪÁË°ÑmysqlÏà¹ØµÄ°ü¶¼ÁгöÀ´£¬Ð¶Ôض¼´Ó×îÏÂÃæµÄÒ»¸ö°ü¿ªÊ¼£¬Ö±µ½Ð¶ÔصôµÚÒ»¸öΪֹ¡£Ö´ÐÐrpm -q php£¬Èç¹û·µ»Øphp°æ±¾£¬ ......
1.ÀàºÍ¶ÔÏó¡£
ÀàÊÇÒ»ÀàÊÂÎïµÄÃèÊö¡£³éÏ󣬸ÅÄîÉϵĶ¨Òå¡£
¶ÔÏóÊÇʵ¼Ê´æÔÚµÄÿ¸ö¸öÌå¡£Ò²½ÐʵÀý¡£¶ÔÏóÊÇnew³öÀ´µÄ¡£$p = new Person();
2.ÊôÐÔ
ÓÃÀ´ÃèÊöÀàÖеÄÊý¾ÝÔªËØ¡££¨Ò²½ÐÊý¾Ý/״̬£©
ÐÞÊηû£¨PHP5ÖбØÐëÐÞÊΣ©:public(¹«¿ª,ÀàµÄÄÚÍⲿ¶ÁÈ¡ÐÞ¸Ä),private(˽ÓÐÖ»ÔÚµ±Ç°ÀàÖжÁÈ¡ÐÞ¸Ä),protected(±£»¤,ÄÜÔÚÕâ¸öÀàºÍ ......