ÔÚvimÖÐʹÓÃxdebugµ÷ÊÔPHP³ÌÐò
²Ù×÷ϵͳcentos 5.3£¬php 5.1.6, xdebug 2.0.5¡£
Ö÷Òª²Î¿¼Îĵµ£º
xdebugµÄ°²×°Îĵµ£ºhttp://xdebug.org/docs/install¡£
xdebugµÄÔ¶³Ìµ÷ÊÔÅäÖÃÎĵµ£ºhttp://xdebug.org/docs/remote
Using vim and xdebug DBGp for debugging Drupal (or any PHP application)£º
http://2bits.com/articles/using-vim-and-xdebug-dbgp-for-debugging-drupal-or-any-php-application.html
һλÍøÓѵIJ©ÎÄ£º
http://blog.johnpupu.tw/2008/05/14/208/
ÐèÒªµÄÈí¼þ°ü£º
vim²å¼þ£¬ÏÂÔصØÖ·£º
http://www.vim.org/scripts/script.php?script_id=1929
xdebug2.0.5£¬ÏÂÔصØÖ·£º
http://xdebug.org/download.php
»¹ÐèÒª°²×°python2.3»òÕßÒÔÉϵİ汾¡£
Ê×ÏÈ°²×°xdebug:
ÏÂÔØxdebug 2.0.5Ô´´úÂë°ü£¬½âѹ£¬½øÈëµ½xdebugÔ´´úÂëĿ¼£¬°´ÕÕÆäÖеÄREADMEÎļþ»òÕßÉÏÃæ¸ø³öµÄxdebug°²×°ÎĵµµÄ˵Ã÷½øÐа²×°¡£ÆäÖÐÒªÓõ½phpize½Å±¾£¬°²×°ÁËphp-develÒÔºó¾Í»áÓÐphpizeºÍphp-configÕâÁ½¸ö½Å±¾¡£
[root@jcwkyl xdebug-2.0.5]# mount /dev/cdrom
[root@jcwkyl xdebug-2.0.5]# localyum install php-devel
[root@jcwkyl xdebug-2.0.5]# phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20050922
Zend Extension Api No: 220051025
[root@jcwkyl xdebug-2.0.5]# ./configure –enable-xdebug
[root@jcwkyl xdebug-2.0.5]# make
Íê³ÉÖ®ºó£¬»áÔÚmodulesĿ¼ÖÐÉú³Éxdebug.soÎļþ¡£
[root@jcwkyl xdebug-2.0.5]# locate php.ini
/etc/php.ini
[root@jcwkyl xdebug-2.0.5]# vim /etc/php.ini
ÔÚÎļþ×îºó¼ÓÉÏÕâÒ»¾ä£º
zend_extension="/home/whb/lib/xdebug-2.0.5/modules/xdebug.so"
[root@jcwkyl xdebug-2.0.5]# service httpd restart
ÑéÖ¤xdebugÒѾ³É¹¦°²×°£º
[root@jcwkyl xdebug-2.0.5]# php -m
[PHP Modules]
bz2
calendar
……
xdebug
……
zlib
[Zend Modules]
Xdebug
¿´µ½xdebug³öÏÖÁËÁ½´Î£¬Ò»´ÎÊÇÔÚ[PHP Modules]ÖУ¬Ò»´ÎÊÇÔÚ[Zend Modules]ÖУ¬Õâ˵Ã÷ËüÒѾ±»³É¹¦°²×°ÁË¡£
°²×°vim²å¼þ£¬°Ñ½âѹºóµÄplugin/debug*¸´ÖƵ½/usr/share/vim/vim70/pluginĿ¼Ï¡£
ÅäÖÃxdebugµÄÔ¶³Ìµ÷ÊÔ£º
ÔÚ/etc/php.iniÖмÓÈëÏÂÃæµÄÉèÖãº
xdebug
Ïà¹ØÎĵµ£º
$_SERVER['PHP_SELF']
#µ±Ç°ÕýÔÚÖ´Ðнű¾µÄÎļþÃû£¬Óë document rootÏà¹Ø¡£
$_SERVER['argv']
#´«µÝ¸ø¸Ã½Å±¾µÄ²ÎÊý¡£
$_SERVER['argc']
#°üº¬´«µÝ¸ø³ÌÐòµÄÃüÁîÐвÎÊýµÄ¸öÊý£¨Èç¹ûÔËÐÐÔÚÃüÁîÐÐģʽ£©¡£
$_SERVER['GATEWAY_INTERFACE']
#·þÎñÆ÷ʹÓÃµÄ CGI ¹æ·¶µÄ°æ±¾¡£ÀýÈ磬“CGI/1.1”¡£
$_SER ......
ÔÀí
Ò»°ã£¬ÓÐ2ÖÖ·½·¨¿ÉÒÔµ¼³ödocÎĵµ£¬Ò»ÖÖÊÇʹÓÃcom£¬²¢ÇÒ×÷ΪphpµÄÒ»¸öÀ©Õ¹¿â°²×°µ½·þÎñÆ÷ÉÏ£¬È»ºó´´½¨Ò»¸öcom£¬µ÷ÓÃËüµÄ·½·¨¡£°²×°¹ýofficeµÄ·þÎñÆ÷¿ÉÒÔµ÷ÓÃÒ»¸ö½Ðword.applicationµÄcom£¬¿ÉÒÔÉú³ÉwordÎĵµ£¬²»¹ýÕâÖÖ·½Ê½ÎÒ²»ÍƼö£¬ÒòΪִÐÐЧÂʱȽϵͣ¨ÎÒ²âÊÔÁËһϣ¬ÔÚÖ´ÐдúÂëµÄʱºò£¬·þÎñÆ÷»áÕ ......
<?php
//¸Ä±äÊý¾Ý¿âÃûÖ®ºó¼´¿ÉʹÓõķÖÒ³
include 'conn.php'; //ÕâÀïÌí¼ÓÒ»¸öÊý¾Ý¿âÁ¬½Ó¼´¿É£¬±ä»»³É×Ô¼ºÉ趨µÄÁ´½Ó
$page=$_GET['page']; //·Ò³Ñ¡Ïî Ê×Ò³£¬ÏÂÒ»Ò³£¬ÉÏÒ»Ò³£¬Î²Ò³
$current= $_GET ......
PHP ʵÏÖ¶à·þÎñÆ÷¹²Ïí SESSION Êý¾Ý
PHP ʵÏÖ¶à·þÎñÆ÷¹²Ïí SESSION Êý¾Ý
Ò»¡¢ÎÊÌâÆðÔ´
ÉÔ´óһЩµÄÍøÕ¾£¬Í¨³£¶¼»áÓкü¸¸ö·þÎñÆ÷£¬Ã¿¸ö·þÎñÆ÷ÔËÐÐ×Ų»Í¬¹¦ÄܵÄÄ£¿é£¬Ê¹Óò»Í¬µÄ¶þ¼¶ÓòÃû£¬¶øÒ»¸öÕûÌåÐÔÇ¿µÄÍøÕ¾
£¬Óû§ÏµÍ³ÊÇͳһµÄ£¬¼´Ò»Ì×
Óû§Ãû¡¢ÃÜÂëÔÚÕû¸öÍøÕ¾µÄ¸÷¸öÄ£¿éÖж¼ÊÇ¿ÉÒԵǼʹÓõġ£¸÷¸ö·þÎñÆ÷¹²ÏíÓû§Êý ......