Php debugging: Eclipse + xampp

Source: Internet
Author: User
After debugging php in windows for half a day, I checked it on the Internet. Most of the versions were too long and didn't work. It was easy to final. Mainly refer to the following two articles: www. laokboke. net20110509how-to-debug-php-using-xdebugmy.oschina.netu1017069blog1199631, tool: Eclipsef

After debugging php in windows for half a day, I checked it on the Internet. Most of the versions were too long and didn't work. It was easy to final. Mainly refer to the following two articles: http://www.laokboke.net/2011/05/09/how-to-debug-php-using-xdebug/ http://my.oschina.net/u/1017069/blog/119963 1. Tools: Eclipse f

After debugging php in windows for half a day, I checked it on the Internet. Most of the versions were too long and didn't work. It was easy to final.

Refer to the following two articles:

Http://www.laokboke.net/2011/05/09/how-to-debug-php-using-xdebug/

Http://my.oschina.net/u/1017069/blog/119963


1. tools:

Eclipse for PHP Developers http://www.eclipse.org/downloads/packages/eclipse-php-developers/heliossr2

Xampphttp: // www.apachefriends.org/en/xampp-windows.html


2. Eclipse settings

Download eclipse for php developers and decompress it to use it. After the eclipse tool is opened, you can configure php and xdebug related information.

Window-> Preferences-> php,

How to call php Website 1

Configure php to run the program first

How to call php website 2

Configure the runtime environment

How to call php website 3

Select php version

How to call php website 4

Configuration server

How to call php website 5

Configure xdebug

How to call php website 6

3. php. ini settings

Xdebug is already included in XAMPP, so you only need to set it slightly.

Modify php. ini: delete the following content [;] at the end of the file.

; Zend_extension = "C: \ xampp \ php \ ext \ php_xdebug.dll"
Bytes
Zend_extension = "C: \ xampp \ php \ ext \ php_xdebug.dll"


; Xdebug. remote_enable = 0
Bytes
Xdebug. remote_enable = 1 * remember to change [0] to [1]


; Xdebug. remote_host = "localhost"
Bytes
Xdebug. remote_host = "localhost"


Restart apache after setting. It can be started in the xampp control center.

4. Create a project in Eclipse

Important: Create the workspace in the working directory: C: \ xampp \ htdocs, which saves a lot of trouble and is easy to modify.

Create a working directory in apache: C: \ xampp \ htdocs \ PhpStudy

Right-click the project and choose Debug deployments. The following screen is displayed. Select Xdebug for Server Debug.

Then select the PHP File you want to debug with the File option.


Start with debug


Some problems may occur in the middle.

1. apache startup failed

Solution: view the process that occupies port 80 or port 443 and disable it.

2. The Web Launch Already Running error occurs when debug starts.

Solution: because you have already started the php Server, disable it and restart it.



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.