当前位置:网站首页>Mac version PHP installed Xdebug environment (M1 version)
Mac version PHP installed Xdebug environment (M1 version)
2022-07-07 05:52:00 【ARCHER359】
The author depends on the environment
1.php7.4
2.macOS 12
3.apache2
4.xdebug3.1.4
5.phpstorm
php7.4 install
brew install php7.4
Remember to put... After installation brew The automatic update software is off , Or the next new version php7.4 May lead to xdebug reinstall
apache2 install ( As if mac Bring their own , I did it again )
brew install apache2
Author default web root /opt/homebrew/var/www Profile directory /opt/homebrew/etc/httpd
xdebug install
Go to the official website to download the latest xdebug

After downloading, we came to php Of bin Catalog , I am here /opt/homebrew/Cellar/[email protected]/7.4.29/bin And then execute sudo ./pecl install xdebug( Just downloaded xdebug Compressed package ), The official is to use arch -arm64 sudo pecl install xdebug Command installation failed here .
After compiling, if there is a warning of missing some directories , And no xdebug.so Words , Just create the missing directory and remember to give permission , Then recompile to generate xdebug.so, After successful compilation, enter php -m Command to see if the installation is successful .

The key is coming.
modify php.ini And add the following .
[xdebug]
zend_extension ="/opt/homebrew/Cellar/[email protected]/7.4.29/pecl/20190902/xdebug.so"; Modify the directory according to yourself
xdebug.idekey="PHPSTORM"
xdebug.client_host=localhost
; port ID,phpstorm The settings must be consistent
xdebug.client_port=9003
; Turn on xdebug Support , Different mode Different uses of , See the official documentation for details
xdebug.mode = debug ; If multiple modes are to be turned on together , Just use `,` Just separate it
xdebug.profiler_append = 0
xdebug.profiler_output_name = cachegrind.out.%p
xdebug.start_with_request = default|yes|no|trigger ; It's different here , It turns out that if you want to open trace or profile, It's using enable_trace,enable_profile Etc
xdebug.trigger_value=StartProfileForMe ; Here is the original profile_trigger_value,trace_trigger_value
xdebug.output_dir = /tmp ; Output file path , Turned out to be output_profiler_dir,trace_dir Set separately , Now use this setting uniformly Verify that the configuration was successful

phpstorm To configure
Put it in advance php Good configuration , And then start debug To configure
1. Create a server

2. Set up Dgbp agent , Want to be with php.ini The configuration is the same .

3. Modify debug port , Want to be with php.ini equally
4. Create a php web page , Select the server we created in the first step , Click verify to check our debugging configuration .


Environmental testing
After turning on the small phone , We came to the browser , Good configuration xdebug plug-in unit , Turn on httpd.
sudo brew services start httpd



You can see the beginning of success debug .
Possible problems in the future
1.httpd Don't parse php
modify httpd.conf Add a row , According to oneself php Installation directory modification
LoadModule php7_module /opt/homebrew/Cellar/[email protected]/7.4.29/lib/httpd/modules/libphp7.so
If not, add another line AddType application/x-httpd-php .php try
2. No, php environment variable
Just edit this file , Then restart a terminal .

边栏推荐
- win配置pm2开机自启node项目
- [solved] record an error in easyexcel [when reading the XLS file, no error will be reported when reading the whole table, and an error will be reported when reading the specified sheet name]
- Wechat applet Bluetooth connects hardware devices and communicates. Applet Bluetooth automatically reconnects due to abnormal distance. JS realizes CRC check bit
- Red Hat安装内核头文件
- Add salt and pepper noise or Gaussian noise to the picture
- [daily training -- Tencent selected 50] 235 Nearest common ancestor of binary search tree
- 盘点国内有哪些EDA公司?
- 分布式事务解决方案之TCC
- Web Authentication API兼容版本信息
- Opensergo is about to release v1alpha1, which will enrich the service governance capabilities of the full link heterogeneous architecture
猜你喜欢

5. Data access - entityframework integration
![Paper reading [open book video captioning with retrieve copy generate network]](/img/13/12567c8c2cea2b2a32051535389785.png)
Paper reading [open book video captioning with retrieve copy generate network]

SQL query: subtract the previous row from the next row and make corresponding calculations

The 2022 China low / no code Market Research and model selection evaluation report was released

Sidecar mode

2pc of distributed transaction solution

C nullable type

软件测试面试技巧

Hcip eighth operation

What is dependency injection (DI)
随机推荐
Flask1.1.4 Werkzeug1.0.1 源碼分析:啟動流程
Simple case of SSM framework
Lombok plug-in
Pinduoduo product details interface, pinduoduo product basic information, pinduoduo product attribute interface
《HarmonyOS实战—入门到开发,浅析原子化服务》
SQLSTATE[HY000][1130] Host ‘host. docker. internal‘ is not allowed to connect to this MySQL server
In memory, I moved from CSDN to blog park!
STM32按键状态机2——状态简化与增加长按功能
ML之shap:基于adult人口普查收入二分类预测数据集(预测年收入是否超过50k)利用shap决策图结合LightGBM模型实现异常值检测案例之详细攻略
AI face editor makes Lena smile
数字IC面试总结(大厂面试经验分享)
Paper reading [semantic tag enlarged xlnv model for video captioning]
Go language context explanation
SQL Server 2008 各种DateTime的取值范围
驱动开发中platform设备驱动架构详解
OpenSergo 即将发布 v1alpha1,丰富全链路异构架构的服务治理能力
SQL query: subtract the previous row from the next row and make corresponding calculations
mac版php装xdebug环境(m1版)
Différenciation et introduction des services groupés, distribués et microservices
What EDA companies are there in China?