php - 在 NetBeans 中调试 php
问题描述
我只是想在 netbeans 中调试 php 代码以了解如何去做,我已经安装了 google chrome netbeans 扩展,但是当我尝试调试我的代码时,一个窗口显示:
“需要 netbeans 连接器 chrome 扩展
要使用 NetBeans 连接器在 Chrome 中运行您的项目,您必须首先在 Chrome Web Store 中安装 NetBeans 连接器扩展。”
另外,我在本地主机中打开了我的项目,当然我可以在 chrome 页面的一角看到 netbeans 图标。
谁能告诉我我做错了什么?
我的操作系统是 ubuntu 18.04
,我的堆栈是 xampp (lampp)
解决方案
在 Netbeans 中调试 php 的一种方法(没有 chrome 扩展):
- Apache 服务器运行
- PHP 配置
- 安装 php-xdebug
添加你的 php.ini:
zend_extension=/usr/lib/php/... 到 .../xdebug.so 的路径
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_mode = req
xdebug.remote_port = 9005
在 Netbeans 中,转到工具 > 选项 > PHP
选项卡常规
- 写下 PHP 解释器的路径
标签调试
- 调试器端口:9000
- 会话 ID:netbeans-xdebug
推荐阅读
- applescript - 如何使用 AppleScript 获取今日提醒数量?
- f# - FSharpPlus:当我尝试组合两个变压器时 fsi 阻塞
- reactjs - React 良好实践 - 如何构建父子组件,包括表单以及在哪里保持状态?
- javascript - 打字稿:对象文字只能指定已知属性
- swiftui - 手动从子视图到父视图以及从拖动中解散时如何修复导航栏标题重叠?
- javascript - 用数组过滤对象
- javascript - 如何确定以下 JavaScript 代码为什么会插入两次计时器记录?
- winforms - Winforms PropertyGrid 没有类别
- r - 根据行值添加特定列值
- python - Python为图像中断PNG添加噪声