Home  >  Article  >  Backend Development  >  Mac+Apache+PHP installation Xdebug method steps

Mac+Apache+PHP installation Xdebug method steps

藏色散人
藏色散人forward
2020-01-30 20:01:282566browse

Mac+Apache+PHP installation Xdebug method steps

MAC homebrew 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 organization so we are continuing to migrate widely used formula into Homebrew/core and encourage more niche formulae and options to be supported outside the Homebrew organization.

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

So you can no longer use the following method I have installed xdebug, but the following method does not work! The following method will not work! The following method will not work!

brew install php<version number>-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 the source of 2.5.4, a tgz compressed package

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

tar -xzf xdebug-2.5.4.tgz
cd xdebug-2.5.4

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

phpize

#If not, write the full path to phpize

./configure

After the above command is executed, the compilation will start

make -j2

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

Mac+Apache+PHP installation Xdebug method steps

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

Note: Search in php.ini extension_dir

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=512
xdebug.var_display_max_data=2048
xdebug.var_display_max_depth=8

After modification, restart apache and check the installation with phpinfo() No, it should be no problem

For more php related knowledge, please visitphp tutorial!

The above is the detailed content of Mac+Apache+PHP installation Xdebug method steps. 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