Home > Backend Development > PHP Tutorial > 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
Release: 2023-04-06 06:42:01
forward
2279 people have browsed it

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.
Copy after login

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<version number>-xdebug
Copy after login

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 the source of 2.5.4, a tgz compressed package

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

 -xzf xdebug-.
Copy after login

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

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

After executing the above command, start compiling

make -j2
Copy after login

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
Copy after login

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!

Related labels:
source:cnblogs.com
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template