VIM + xdebug + dbgp => phpdebug

Source: Internet
Author: User
Tags zts

After thinking about the editor for a while, I want to start preparing to write the program, so the debug schedule is raised. This is to build the vim-based PHP editing platform...

--------------------------------------------------------------------------------

| System
| Cenos 5.7

--------------------------------------------------------------------------------

| Editor
| Vim 7.3.456

--------------------------------------------------------------------------------

First, we recommend that you compile the vim version by yourself, because you need to enable the support for + Python and + sign, or you are advised to play well in the Linux of the virtual machine or on the Development machine...

Configure Vim

Python 5.7 On centos 2.4 is available in version 2.6. If you need Python 3.0 or, you can install python on your own.

# Yum install Python-devel Python mercurial

# Hg clone https://vim.googlecode.com/hg/ Vim

# Cd Vim

#./configure --prefix=/usr/local/vim --with-features=huge --enable-multibyte --enable-cscope --enable-gui=gtk2 --enable-pythoninterp=yes --with-python-config-dir=/usr/lib/python2.4/config

# Vim/etc/profile |-alias Vim = "/usr/local/Vim/bin/Vim"

# Vim # enter the command mode: version to check whether there are + Python and + sign. If yes, congratulations. If not, Google...

Install the vim dbgp plug-in

Http://www.vim.org/scripts/script.php? Script_id = 1, 2508

install detailsjust copy the debugger.py and debugger.vim to the plugin directory in your home directory $ tar -xzvf debugger.tar.gz $ cp plugin/debugger.*  ~/.vim/plugin/

Configure xdebug

#/Tmp/lnpp/PHP/bin/PECL install xdebug

# Vim/tmp/lnpp/PHP/etc/PHP. ini

[Zend]zend_extension="/tmp/lnpp/php/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"xdebug.remote_enable=1;xdebug.remote_handler=dbgpxdebug.remote_port = 9001xdebug.remote_host = localhost

Note that zend_extension is your own path
Then restart the PHP background service...

#/Tmp/lnpp/PHP/bin/PHP-m
Check whether

[php]Xdebug...[Zend Modules]Xdebug

So that we can start debugging...

# Cd/tmp/lnpp/nginx/html/

# Vim phpinfo. php # Vim ~ /. Vimrc |-Let G: debuggerport = 9001


Stop the cursor on the line where you want to set the breakpoint and enter the command mode: BP sets the breakpoint...


Next, press F5 to start listening, as shown in the figure below:



Format: webpage address? Xdebug_session_start = 1

For more information, see the following steps:

Http://download.csdn.net/detail/qzier_go/4106469

We have established an lnpp group. Welcome to join us (QQ Group No.: 213572677)


Revision

Php.5.4: configure the location of PHP. ini before installing xdebug.

#/Tmp/lnpp/PHP/bin/Pear
Config-set/tmp/lnpp/PHP/etc/PHP. ini

#/Tmp/lnpp/PHP/bin/PECL config-set/tmp/lnpp/PHP/etc/PHP. ini

#/Tmp/lnpp/PHP/bin/PECL
Install xdebug


Build process completed successfullyInstalling '/tmp/lnpp/php/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so'install ok: channel://pecl.php.net/xdebug-2.2.0RC1Extension xdebug enabled in php.ini

Then open PHP. ini to modify it.

[xdebug]zend_extension="/tmp/lnpp/lnpp-0.05/php/php-5.4.0/lib/php/extensions/no-debug-  non-zts-20100525/xdebug.so";xdebug.show_local_vars=1xdebug.remote_enable=on;xdebug.remote_autostart=1xdebug.remote_handler=dbgp;xdebug.remote_host=localhostxdebug.remote_port=9002xdebug.remote_connect_back = 1xdebug.remote_log=/var/log/xdedug.log

If you need to uninstall it, use

#/Tmp/lnpp/PHP/bin/PECL
Uninstall xdebug


Xdebug Official Website

Http://xdebug.org/docs/remote


Reference:

Https://writer.zoho.com/public/6b6a49b6dcbb8205336873dd09e1b3517a451cd1e1176acb3144f48e4cef0c6b6db04614eed231e5


 
 
 
 
 
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.