学习笔记:Mac下PhpStorm+XAMPP+Xdebug环境搭建和应用部署

一、下载安装PhpStorm和XAMPP

在官网安装,有30天试用期。

二、用PhpStorm运行一个web项目

在phpStorm的右上角点击“Edit Configurations”后,

点击“PHP Web Page”后,填写Start URL,再将相应文件拷贝到XAMPP自带的web服务器中,即可运行web项目。

三、生成下载安装php对应版本的Xdebug.so

1、通过Wizard安装php对应版本的Xdebug

1.1 启动Apache Web Server;

1.2 浏览器输入localhost/dashboard/phpinfo.php,即可查看配置信息;

1.3 进入网址后右键-查看源码;

1.4 然后ctrl a 全选后复制粘贴到https://xdebug.org/wizard.php/

1.5 根据显示的xdebug安装步骤进行安装

php-version

2、生成Xdebug.so

2、编译

3、配置PHP以使Xdebug运行

4、相关设置和功能

注意:

如果你使用AMP包,Xdebug就已经安装了。

命令行中系统自带的PHP版本和PHPSRTROM中的版本可能不同。

XAMPP的bin下自带pecl

安装和配置AMP包:

  • XAMPP for Windows.

  • The LAMP package compatible with the Linux distribution used.

  • MAMP for macOS.

四、phpStorm中配置使用xdebug进行调试

远程调试、单步调试、跟踪

 

 

 

注:遇到自己不会的不要怕,多开动脑筋思考,多上网搜,多问有经验的老工程师。

参考:

https://www.wangquanwei.com/166.html

https://blog.csdn.net/yinhangbbbbb/article/details/79247331

https://xdebug.org/docs/install

https://xdebug.org/wizard

个人配置:

[XDebug]
zend_extension = xdebug.so
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.remote_mode="req"
xdebug.remote_host="localhost"
xdebug.remote_port=9999
xdebug.remote_handler="dbgp"
xdebug.idekey="PHPSTORM"
xdebug.max_nesting_level=600

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值