加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 运营中心 > Nginx > 正文

如何在Mac上使用带有PHPStorm的Nginx上的Xdebug和Laravel?

发布时间:2020-12-13 21:30:29 所属栏目:Nginx 来源:网络整理
导读:有关如何使用PHPStorm设置XDebug的指南. 版本: PHP 7.0 PHPStorm 2016.3.2 XDebug 2.5 OS X El Capitan 10.11.6 最佳答案 本指南仅适用于PHP7,Mac El Capitan,PHPStorm 2016.3 安装brew http://brew.sh/ 安装php7 brew install php70 安装nginx 指南 http:/

有关如何使用PHPStorm设置XDebug的指南.

版本:

> PHP 7.0
> PHPStorm 2016.3.2
> XDebug 2.5
> OS X El Capitan 10.11.6

最佳答案
本指南仅适用于PHP7,Mac El Capitan,PHPStorm 2016.3

>安装brew http://brew.sh/
>安装php7 brew install php70
>安装nginx

指南 – http://learnaholic.me/2012/10/10/installing-nginx-in-mac-os-x-mountain-lion/

配置 – https://gist.github.com/kmaxat/c07795ab88677efb843686d075fafa9e
> brew安装php70-xdebug
>在laravel的公共文件夹中创建info.php文件:

info.php:<?php phpinfo();
>编辑文件/usr/local/etc/php7.0/conf.d/ext-xdebug.ini

的zend_extension = “在/ usr /本地的/ opt / php70-的XDebug / xdebug.so”
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9001
xdebug.scream = 0
xdebug.show_local_vars = 1
xdebug.idekey = PHPSTORM
>重新启动nginx sudo nginx -s reload或brew services restart nginx
>重启php-fpm brew services重启php70
>转到localhost / info.php,您应该可以看到xdebug.部分图片:

List item

>设置CLI解释器. PHPStorm – >设置 – >语言与框架 – > PHP

enter image description here

>单击CLI解释器旁边的“…”.如果上述步骤正确完成,您应该能够看到:

enter image description here

>设置服务器:
运行 – >编辑配置 – > …(服务器旁边).

enter image description here

>设置编辑配置
运行 – >编辑配置 – > – > PHP Web应用程序.选择创建的服务器,设置名称

enter image description here

>在工具栏中选择已创建的服务器,然后单击“开始侦听PHP调试连接”.

enter image description here

>在public / index.php中设置断点

enter image description here

>在工具栏中单击“Debug’ServerName’”

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读