Home>Article>Backend Development> Detailed process of installing Xdebug using Apache and PHP under Mac system

Detailed process of installing Xdebug using Apache and PHP under Mac system

little bottle
little bottle forward
2019-04-19 15:41:41 2181browse

This article mainly talks about the detailed process of installing Xdebug using Apache and PHP under Mac system. Interested friends can learn about it.

MAC homebrew has deprecated homebrew/php since 2018/3/31

By 31st March 2018 we will deprecate and archive the Homebrew/php tap. Unfortunately we have been unable to maintain an acceptable, consistent user or contributor experience and CI workload through non-core formula taps in the Homebrew organisation so we are continuing to migrate widely used formulae into Homebrew/core and encourage more niche formulae and options to be supported outside the Homebrew organisation.

Details: https://brew.sh/2018/01/19/homebrew-1.5.0/

So you can no longer use the following method to install xdebug, the following method will not work! The following method will not work! The following method will not work!

brew install php-xdebug

So, to install xdebug we can manually compile it. The specific steps are as follows:

1. First enter the Xdebug official download page: https://xdebug.org/ download.php, download and install the version of xdebug supported by the php version

Eg. My local PHP version is 5.6.38, so I downloaded thesource of 2.5.4, a tgz compressed package

2. Open the terminal in the folder where you downloaded xdebug

-xzf xdebug-.

You can also decompress it locally, and then enter the decompressed xdebug folder. Open the terminal

phpize #如果不可以,写phpize的完整路径 ./configure

After executing the above command, start compiling

make -j2

After the compilation is completed, you will be prompted that the xdebug.so file can be found in modules

3. Copy the xdebug.so file obtained after compilation to the folder specified by extension_dir

Note: Search extension_dir

# in php.ini

##4. Configure the parameters in php.ini

[Xdebug] zend_extension="/usr/local/lib/php/pecl/20131226/xdebug.so";自动跟踪,可关闭(关闭后提升性能) xdebug.auto_trace=On ;性能分析,可关闭(关闭后提升性能) xdebug.profiler_enable=On xdebug.var_display_max_children=512xdebug.var_display_max_data=2048xdebug.var_display_max_depth=8

After modification, restart apache and use phpinfo() to check whether it is installed. It should be fine.

Related videos:

PHP video tutorial

The above is the detailed content of Detailed process of installing Xdebug using Apache and PHP under Mac system. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:cnblogs.com. If there is any infringement, please contact admin@php.cn delete