#### Repository https://github.com/AlanZheng/Tutorial.devel #### What Will I Learn? - How to recompile vim from source code to enable a feature, such as enable python3 - How to configure the vdebug for vim. - How to configure xdebug and work together with vdebug. #### Requirements - CentOS e17 - vim source code: https://github.com/vim/vim - vdebug source code: https://github.com/vim-vdebug/vdebug - PHP 5.6.38 - xdebug 2.5.5 #### Difficulty - Intermediate #### Tutorial Contents 1. Verifying vim information by run: **vim --version** to see its output is +python3 or -python3, plus symbol means this feature enable, otherwise disabled. The default vim distribution disabled python3 on CentOS e17. So we have recompiled the vim from source code to enable it.  2. Get the vim source code from : https://github.com/vim/vim by below command: ``` git clone https://github.com/vim/vim.git ``` Then changing the directory into vim source code to run **./configure --enable-python3interp=yes**, after that just type make command to compile it. if things done you can find the vim executable in src directory, so goes into src directory and run **./vim --version** to check again. I believe the output will have **+python3** as above picture. Now you can install the new vim to replace the default one. 3. Get the vdebug source code from https://github.com/vim-vdebug/vdebug.git by below command: ``` git clone https://github.com/vim-vdebug/vdebug.git` ``` Then copy/move its content in your ~/.vim/ directory. You should call **:helptags ~/.vim/doc** in vim to generate the necessary help tags, after that to run **:help vdebug** in vim, if you see something like below, that means your vdebug worked well with vim.  4. Add below code into your ~/.vimrc ``` let g:vdebug_options = {} let g:vdebug_options["port"] = 7000 ``` 5. Configure your xdebug, you should add below code into your php.ini: ``` xdebug.remote_enable=1 xdebug.remote_host=127.0.0.1 xdebug.remote_port=7000 xdebug.remote_log="/tmp/xdebug.log" ``` NOTE: the xdebug's port must same with vdebug's as above. 6. To create a file phpinfo.php, and put below code in it. ``` <?php phpinfo(); ?> ``` Then to verify if xdebug configure worked well: ``` php phpinfo.php | grep xdebug ``` 7. Open a php file by vim, then press **F10** to set a break point to cursor line, then press **F5** to let vdebug waiting for connection as below.  8. After that to access this php from browser(firefox/chrome), the xdebug should work now, and you will able to see debug status in the vim, more vdebug command you can type **:help vdebug** in vim.  If there is anything won't work for your case, please contact me freely. #### Refer to: http://alanzheng.top/doku.php?id=tutorials:php:debug_php_by_vim
author | alanzheng |
---|---|
permlink | how-to-debug-php-by-vim-vdebug-and-xdebug |
category | utopian-io |
json_metadata | {"tags":["utopian-io","tutorials","vim","vdebug","xdebug"],"image":["https://github.com/AlanZheng/Tutorial.devel/raw/master/vim_version.png","https://github.com/AlanZheng/Tutorial.devel/raw/master/vdebug_doc.png","https://github.com/AlanZheng/Tutorial.devel/raw/master/vdebug_break.png","https://github.com/AlanZheng/Tutorial.devel/raw/master/vdebug_debug.png"],"links":["https://github.com/AlanZheng/Tutorial.devel","https://github.com/vim/vim","https://github.com/vim-vdebug/vdebug","https://github.com/vim-vdebug/vdebug.git","http://alanzheng.top/doku.php?id=tutorials:php:debug_php_by_vim"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-10-16 13:58:39 |
last_update | 2018-10-22 11:23:39 |
depth | 0 |
children | 3 |
last_payout | 2018-10-23 13:58:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.022 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3,229 |
author_reputation | 2,727,533,211,976 |
root_title | "Fully step by step guide how to debug php by vim+vdebug and xdebug" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 73,413,930 |
net_rshares | 24,017,891,500 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
leir | 0 | 1,930,711,363 | 50% | ||
espoem | 0 | 2,752,161,447 | 2.27% | ||
alanzheng | 0 | 7,032,028,772 | 100% | ||
azcax | 0 | 558,461,914 | 100% | ||
xiaodong | 0 | 196,042,606 | 100% | ||
zhengxiaodong | 0 | 196,031,847 | 100% | ||
steemlua | 0 | 1,020,316,076 | 100% | ||
hao.zheng | 0 | 72,901,038 | 100% | ||
xmlyan-luoli | 0 | 72,866,020 | 100% | ||
honge.yang | 0 | 556,343,454 | 100% | ||
dailystat | 0 | 72,814,983 | 100% | ||
resteemd | 0 | 72,814,876 | 100% | ||
geekshop | 0 | 72,773,036 | 100% | ||
coinsandchains | 0 | 3,759,180,480 | 8% | ||
mops2e | 0 | 26,678,184 | 2.27% | ||
jacekw.dev | 0 | 1,769,952,753 | 100% | ||
curbot | 0 | 3,855,812,651 | 10% |
I thank you for your contribution. Here are my thoughts; * **Structure** * Formatting of the post is kinda untidy and images are not showing. I advise you to use markdown language to format. * **Language** * Your post contains a large number of complex sentences. They are understandable, but addressing them will both increase your language ability and the efficiency of the post. Here is an example sentence: * "To verify if your vim enable python3 by run: vim --version, it will output below information, if you see +python3, that means your vim enabled python3, if you see -python3, that means you need recompile vim from source code to enable python3." As you can see, there are multiple sentences in one sentence, separated with commas. Some languages like Turkish support this kind of sentence-crafting and it is quite easy to understand that. But in English, it can result in complex sentences. * **Content** * You might consider changing topics to preserve some uniqueness. The concept is generally too simple and similar can be easily found on the internet. Being unique with tutorials on Utopian is not required, but preferable as we value rare posts more than others. ---- Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category. ---- Need help? Write a ticket on https://support.utopian.io/. Chat with us on [Discord](https://discord.gg/uTyJkNm). [[utopian-moderator]](https://join.utopian.io/)
author | yokunjon |
---|---|
permlink | re-alanzheng-how-to-debug-php-by-vim-vdebug-and-xdebug-20181016t161846208z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"} |
created | 2018-10-16 16:18:48 |
last_update | 2018-10-16 16:18:48 |
depth | 1 |
children | 2 |
last_payout | 2018-10-23 16:18:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 5.792 HBD |
curator_payout_value | 1.877 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1,572 |
author_reputation | 19,266,807,595,513 |
root_title | "Fully step by step guide how to debug php by vim+vdebug and xdebug" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 73,422,947 |
net_rshares | 6,105,604,650,173 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
pixelfan | 0 | 1,150,176,584 | 0.54% | ||
jadabug | 0 | 435,311,651 | 2% | ||
fbslo | 0 | 30,011,655,704 | 10% | ||
utopian-io | 0 | 5,994,880,375,574 | 4.23% | ||
emrebeyler | 0 | 30,378,771,482 | 2% | ||
organicgardener | 0 | 2,446,991,737 | 25% | ||
hakancelik | 0 | 13,568,924,071 | 20% | ||
mythosacademy | 0 | 437,408,580 | 5% | ||
mightypanda | 0 | 29,366,375,544 | 25% | ||
fastandcurious | 0 | 1,557,366,912 | 35% | ||
rpc34 | 0 | 473,420,854 | 100% | ||
n33d | 0 | 462,002,318 | 100% | ||
hdu | 0 | 435,869,162 | 4% |
@yokunjon, thanks for review and suggestion! I fixed them, please review it again. I write the markdown by Typora, if you know better one, please suggest. :-)
author | alanzheng |
---|---|
permlink | re-yokunjon-re-alanzheng-how-to-debug-php-by-vim-vdebug-and-xdebug-20181017t052226190z |
category | utopian-io |
json_metadata | {"tags":["utopian-io"],"users":["yokunjon"],"app":"steemit/0.1"} |
created | 2018-10-17 05:22:27 |
last_update | 2018-10-17 05:22:27 |
depth | 2 |
children | 0 |
last_payout | 2018-10-24 05:22:27 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 158 |
author_reputation | 2,727,533,211,976 |
root_title | "Fully step by step guide how to debug php by vim+vdebug and xdebug" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 73,457,606 |
net_rshares | 10,007,704,124 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yokunjon | 0 | 10,007,704,124 | 100% |
Thank you for your review, @yokunjon! So far this week you've reviewed 8 contributions. Keep up the good work!
author | utopian-io |
---|---|
permlink | re-re-alanzheng-how-to-debug-php-by-vim-vdebug-and-xdebug-20181016t161846208z-20181021t121523z |
category | utopian-io |
json_metadata | "{"app": "beem/0.20.1"}" |
created | 2018-10-21 12:15:24 |
last_update | 2018-10-21 12:15:24 |
depth | 2 |
children | 0 |
last_payout | 2018-10-28 12:15:24 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 111 |
author_reputation | 152,955,367,999,756 |
root_title | "Fully step by step guide how to debug php by vim+vdebug and xdebug" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 73,745,667 |
net_rshares | 9,863,473,853 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
yokunjon | 0 | 9,863,473,853 | 100% |