Using Xdebug+eclipse to remotely debug PHP code on CENTOS7

Source: Internet
Author: User

These two days have been studying PHP code debugging, the original development has been using the Var_dump, trouble!

Recently found to be able to use Xdebug+eclipse remote single-step debugging PHP, but Baidu after the implementation of this technology articles are not written enough specific.

I followed the scattered articles here for 2 days, finished, complete the process of finishing a copy, easy to access.

1. First install Xdebug, go to http://xdebug.org/wizard.php to copy your Phpinfo (), follow the prompts to install.

After installation, go to configure php.ini plus the following words:

[Xdebug]xdebug. remote_enable = 1xdebug. remote_host = 10.2.1.197xdebug. Remote_port = 9000 xdebug. Remote_handler = "DBGP"xdebug. Remote_autostart ==/usr/lib64/php/modules/ Xdebug.so

Reboot Apache after completion.

(1) phpize if prompted "Can ' t find PHP headers in/usr/include/php

The Php-devel package was required for use of this command. "

    That means Php-devel is not installed.

Enter the Yum install Php-devel installation.

2. Install PDT Eclipse and go to http://www.eclipse.org/pdt/#download按提示下载安装

3. Configure XDebug debugging in Eclipse, first menu window->preferences->php->debug->installed debuggers->xdebug,

  

4. Set the default debug browser in Eclipse to Chrome

5.Chrome Google Chrome installation xdebug extension "Xdebug helper", OK later in the extension program set up

Set the Extender to eclipse.

5. Add the code, place the server PHP code copy on the window and add the project to eclipse

6. Using Chrome to access the Server page, click Debug in the image below

Then refresh the page and jump back into Eclipse and start debugging:)

Use Xdebug+eclipse to remotely debug PHP code on centOS7

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.