Use XAMPP and Xdebug, plus eclipse-php to debug programs

Source: Internet
Author: User


Because of the use of the XAMPP integrated environment, directly using the default php.ini settings, yesterday found a unique xampp, such as its configuration of the virtual host


Httpd-vhosts.conf is differentiated from httpd.conf so that in httpd.conf you can only use the


<directory "E:\www\trunk\admin" >
Options FollowSymLinks
AllowOverride All
Order Allow,deny
Allow from all
</Directory>


Configures the Apache server's access to partial file directories, and then adds a URL address to the file directory in httpd-vhosts.conf:


<virtualhost *:80>
DocumentRoot "E:\www\trunk\admin"
ServerName dev.admin.local
Alias/scripts "E:\www\trunk\common\javascripts"
Alias/files "E:\www\trunk\files"
</VirtualHost>


Users will be able to access this directory through dev.admin.local.


many times the installation Xdebug will have an exception, such as prompting



At this time, the XDEBUG is configured in a certain degree, while




You can use Xdebug, but in particular, there are a number of default values in the XAMPP php.ini configuration file that need to be adjusted by the user, such as the default


[XDebug]
Zend_extension = "C:\xampp\php\ext\php_xdebug.dll"




; Xdebug.remote_enable
; Type:boolean, Default value:0
; This switch controls whether Xdebug should try to contacts a debug client which is listening on the
; Host and Port as set with the settings Xdebug.remote_host and Xdebug.remote_port. If a connection
; Can not be established the script would just continue as if this setting is off.
Xdebug.remote_enable = True


; Xdebug.remote_handler
; Type:string, Default VALUE:DBGP
; Can be either ' php3 ' which selects the old PHP 3 style debugger output, ' gdb ' which enables the GDB
; Like debugger interface or ' DBGP '-the brand new debugger protocol. The DBGP protocol is more
; Widely supported by clients. Information in the introduction for Remote debugging.
Xdebug.remote_handler = "DBGP"


; Xdebug.remote_host
; Type:string, Default Value:localhost
; Selects the host where the debug client is running, can either use a host name or a IP
; Address.
Xdebug.remote_host = "localhost"


; Xdebug.remote_log
; Type:string, Default Value:none
; If set to a value, it are used as filename to a file to which all remote debugger communications are
; Logged. The file is always opened in Append-mode, and would therefore the not to overwritten by default.
; There is no concurrency protection available.
Xdebug.remote_log = "None"


; Xdebug.remote_mode
; Type:string, Default Value:req
;
; Selects when a debug connection is initiated. This setting can have two different values:
;
; Req
; Xdebug'll try to connect to the debug client as soon as the script starts.
; Jit
; Xdebug'll only try to connect to the debug client as soon as a error condition occurs.
; xdebug.remote_mode = "req"


; Xdebug.remote_port
; Type:integer, Default value:9000
; The port to which Xdebug tries to connect on the remote host. Port 9000 is the default for both the
; The client and the bundled debugclient. As many clients use this port number, it's best to leave this
; Setting unchanged.
Xdebug.remote_port = 9000


For previously used, commented lines, you need to uncomment it and then allow the server to use PHP normally. To understand the true features of Xdebug, you can refer to the following English articles,


As I used to debug code, I always like to use Print_r (); exit (); The downside is that if you make changes online, it's easy to use Xdebug.


Outside users have their own debugging code when they visit. I avoided this problem when I was dealing with xdebug.


The effect of the debugging is as follows:




If not, refer to the Firefox plugin for Zend Studio that I talked about last time.


Http://www.cnblogs.com/yeer/archive/2010/04/07/1706407.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.