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