跳转到主要内容
你行网

Main navigation

  • 首页
  • Drupal
  • 编程与开发
  • 数据库
  • 操作系统与应用
  • 服务器与运维
  • 社区
User account menu
  • 登录

面包屑

  1. 首页

在Debian / Ubuntu上为PHP设置xdebug / DBGp

由 hrs, 1 十月, 2019

开发人员经常需要跟踪其代码的执行情况并对其进行调试,Drupal / PHP也不例外。

有几种可用的PHP调试框架/ API,包括DBG,Gubed,Zend和xdebug。它们每个都支持不同的IDE(集成开发环境)。

本文重点介绍xdebug,以及如何在开发计算机或服务器上进行设置。

xdebug使用DBGp协议,使多个人可以在同一服务器上同时进行调试会话。但是,并非所有可用的IDE都支持此功能。

当前使用DBGp的IDE是:

  • 带xdebug插件的Vim(命令行,非GUI)。
  • ActiveState Komodo(多平台)
  • Quanta Plus(Linux上的KDE)

安装

要在debian / Ubuntu系统上安装xdebug,请从sudo bash或root shell输入以下命令:

首先,如果尚未安装PHP和MySQL,请安装它们。如果没有图像处理模块,则可能不需要gd库。

aptitude安装apache2 php5 php5-gd mysql-server php5-mysql

接下来,安装PHP开发,Apache开发和PEAR。

aptitude install apache2-dev php5-dev php-pear make

最后,使用PHP的pecl安装xdebug

pecl安装xdebug-beta 

最后一步将运行一段时间,从源代码编译xdebug。它应该没有任何错误。 

组态

最后一条命令完成后,您将拥有一个xdebug.so库。现在,您需要配置apache才能使用它。

为此,请编辑您的PHP配置文件/etc/php5/apache2/php.ini,并在[Date]标题之前添加以下部分:

zend_extension = / usr / lib / php5 / 20051025 / xdebug.so 

[debug] 
; 远程设置
xdebug.remote_autostart = off 
xdebug.remote_enable = on 
xdebug.remote_handler = dbgp 
xdebug.remote_mode = req 
xdebug.remote_host = localhost 
xdebug.remote_port = 9000 

; 常规
xdebug.auto_trace = off 
xdebug.collect_includes = on 
xdebug.collect_params = off 
xdebug.collect_return = off 
xdebug.default_enable = on 
xdebug.extended_info = 1 
xdebug.manual_url = http://www.php.net 
xdebug.show_local_vars = 0 
xdebug .show_mem_delta = 0 
xdebug.max_nesting_level = 100 
; xdebug.idekey = 

; 跟踪选项
xdebug.trace_format = 0
xdebug.trace_output_dir = / tmp 
xdebug.trace_options = 0 
xdebug.trace_output_name = crc32 

; 分析
xdebug.profiler_append = 0 
xdebug.profiler_enable = 0 
xdebug.profiler_enable_trigger = 0 
xdebug.profiler_output_dir = / tmp 
xdebug.profiler_output_name = crc32

如果在与运行IDE的计算机不同的服务器上使用此服务器,则将xdebug.remote_host中的主机名从localhost更改为服务器的名称。

现在,您可以使用支持DBGp的IDE来调试PHP应用程序,包括Drupal。

  • 登录或注册以发表评论
来源
https://2bits.com/articles/setting-up-xdebug-dbgp-for-php-on-debian-ubuntu.html
内容类型分类
技术文章
文章归类
编程与开发

文章标签

  • xdebug

评论

文章标签

CSS
Excel
ubuntu
php
vim
五笔
Linux
VPN
command
HTML
drupal 8
drupal 7
centos
composer
Mysql
drush
模块(module)
Drupal
JavaSrcipt
apache
drupal 9
英语
nerdtree
SEO
network
果树种植
surround
drupal10
主题(theme)
ssh
phpmyadmin
yum
二进制
权限
声音
ssl
selinux
HTML5
WireGuard
password
Dreamweaver
DDEV
flameshot
翻译
颜色
uploadprogress
firewalld
kernel
邮件验证
视图(views)
快捷键
gzip
xdebug
错误
电脑基础
ckeditor
C语言
简介
源地址
mbstring
certbot
php扩展
git
csharp
httpd
apt
电子秤
压缩解压
breadcrumb
表单
短信验证
AI
firmware
摄影
diff
superfish
重定向
drupal 11
网站备份
docker
版本号
tagclouds
java
RSS
adsense
端口
电脑技巧
simple_adsense
KVM
算法
youtube
JavaScript
cookie
badblocks
网站运营
计算机基础
RFID
zip
标签优化
VUE
dns
gimp
form
mod_expires 模块
赚钱
ip
http验证
curl
重定向,301
netstat
字段
maven
input
nginx
哈希值
npm
wps
更多

相关文章

  • 因权限问题导致drupal cms 无法正常安装,那么该如何解决这个问题
  • kvm虚拟机启动失败:default网络未激活
  • ubuntu 安装kvm 虚拟机
  • 匿名函数(Anonymous Functions)详解
  • foreach 是 PHP 循环语句使用方法
  • implode() 函数的定义和用法
  • Drupal 11 主题制作教程
  • 检查 Composer 是否为官方源
  • 在 Drupal 中权重(Weight)是怎样排序的
  • 解决 Drupal 主题缺失问题
RSS源

友情链接 网站地图 版权信息 联系我们 网址导航 社区

Copyright © 2019 - 2021 你行网 版权所有  粤ICP备19072650号