Ubuntu 18.04 VScode use php-debug plug-ins

1 installation xdebug

Install php-dev

apt-get install php7.X-dev autoconf automake
复制代码
Please 7.X above into the corresponding php version number, or by default download the latest version of php.

Use the corresponding packet xdebug

Here are two ways to get xdebug packet mode currently applicable:

1 directly to the official website xdebug xdebug , download the corresponding packet
2 .php create a file, enter the code:

<?php phpinfo() ?>
复制代码
然后在网页上跑起来之后,将所有有的信息复制并输入下面的网站的框框之后
复制代码

xdebug

  • Create a php file, and then output the corresponding php version information on the page

  • Copy all of the information, and writes the white borders of the FIG.

  • Under normal circumstances, you will get the following page

Here there is the installation of a series of processes, the only caveat is that

apt-get install php7.X-dev autoconf automake
复制代码

php-dev command line after this statement, we must add the corresponding version, or may be a lot of pit.

1 configuration VScode

Using the command line, find the corresponding directory run php

which php
复制代码

In vsCode document - "Preferences -" setting, open setting.json file, add the following statement

    "php.validate.executablePath": "/usr/bin/php"

复制代码

The path back to run your own php directory.

Restart web server with php

sudo /etc/init.d/nginx restart
service php7.2-fpm restart 
复制代码

Under normal circumstances, ubuntu php directory there will be two, one for the clidirectory, the corresponding command line, as a fpmdirectory, the corresponding web page, so if you only configure the fpmdirectory, the command line at the output of php -vthe time, you will find there is no linked to xdebug, if you want to query corresponding to xdebugthe association if, just use just created test.phpa file, and then view the page if the next chart presence, that is normal.

Finish

Reproduced in: https: //juejin.im/post/5cf4831cf265da1b6028ece2

Guess you like

Origin blog.csdn.net/weixin_33670713/article/details/91439725