Home > Backend Development > PHP Tutorial > A brief introduction to the method of installing and debugging tool Xdebug extension for PHP7

A brief introduction to the method of installing and debugging tool Xdebug extension for PHP7

巴扎黑
Release: 2023-03-14 17:28:01
Original
1871 people have browsed it

Xdebug provides a wealth of debugging functions. You can also install and configure Xdebug as a third-party plug-in for zend studio and editplus to debug PHP. By turning on the automatic tracing (auto_trace) and analyzer functions, you can intuitively see the PHP source code. Performance data in order to optimize PHP code. This article introduces how to install the debugging tool Xdebug extension for PHP 7. Friends in need can refer to it.

Preface

When it comes to PHP code debugging, for experienced PHPers, use the echo, print_r, var_dump function, or the PHP development tool zend Studio and editplus can solve most problems, but it is difficult for children who are starting to learn PHP. Moreover, it is difficult to accurately find PHP performance problems only through the above-mentioned PHP debugging methods. Xdebug is a very useful PHP tool. Debugging tools.

Test environment

  • LNMP Junge one-click package version 1.3

  • PHP 7.0.7

  • Xdebug 2.6

Configuration steps

Execute the following commands according to your own environment to install. Remember not to copy and execute them as they are


##

git clone git://github.com/xdebug/xdebug.git
cd xdebug
find / -name phpize
/usr/bin/phpize
find / -name php-config
./configure --enable-xdebug --with-php-config=/usr/local/php/bin/php-config
make 
make install
Copy after login

The following prompt indicates that the installation is successful

Open the extension


find / -name php.ini
vi /usr/local/php/etc/php.ini
添加 extension=xdebug.so
service restart php-fpm
Copy after login

When accessing phpinfo, the following prompt appears, indicating that the extension is successfully opened

Summarize

The above is the detailed content of A brief introduction to the method of installing and debugging tool Xdebug extension for PHP7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template