xdebug

Yii2 Day 2: 配置PHPStorm

寵の児 提交于 2019-11-28 19:18:04
XDebug 配置 Yii2那么多的代码,难免需要跟踪调试的地方,因此XDebug必不可少。因为XAMPP已经带着xdebu扩展,所以只需要更改下php.ini文件,就可以启用这个扩展啦: <!-- lang: php --> zend_extension = "D:\xampp\php\ext\php_xdebug.dll"(根据实际情况确定) xdebug.remote_enable =1 xdebug.remote_handler = "dbgp" xdebug.remote_host = "localhost" xdebug.remote_mode = "req" xdebug.remote_port = 9000 启用扩展后,可以用phpinfo看看,是不是有这个扩展啦。有了之后,就保证可以让php的调试信息发到remote_host的remote_port端口啦。接下去配置PHPStorm: 进入File>Settings>PHP>Servers,这里要填写服务器端的相关信息: name: localhost, host: localhost, port: 80, debugger: XDebug 进入File>Settings>PHP>Debug,找到XDebug选项卡,port填9000 进入File>Settings>PHP>Debug>DBGp Proxy 填写

Xdebug trace GUI? [closed]

被刻印的时光 ゝ 提交于 2019-11-28 18:13:58
I'm trying to find a GUI to parse and view Xdebug trace files . Although you can make them human readable, the sheer number of lines makes it unusable. I'm looking for something like KCachegrind but for a trace file. My main goal behind all this is to find what the memory hogs are. I found this to be pretty solid. Maybe it's serviceable to you, too: https://github.com/corretge/xdebug-trace-gui vdrmrt I found this one: xdebug trace file parser . I just using started xdebug today came across this problem a few ahours ago too. I'd love a cachegrind style gui for xdebug traces. A lot of the lower

How can I debug a PHP CLI script with xdebug?

天涯浪子 提交于 2019-11-28 17:32:46
问题 I haven't quite figured this out. EVERY piece of documentation I've found covers how to use xdebug to debug scripts running in Apache. I need to debug a php CLI script. So, for instance, how do I pass the XDEBUG_SESSION_START variable in to get xdebug to kick on? I'm specifically trying to debug a CakePHP shell. So if anyone has any additional insight into that I'd be very appreciative. Thanks. 回答1: There is a couple of notes about that in Xdebug's manual, like, for instance (quoting) :

How to debug PHP with netbeans and Xdebug

左心房为你撑大大i 提交于 2019-11-28 17:19:12
I have recently tried to get going with Netbeans 6.5 after it rated so highly in the IDE review by Smashing magazine. http://www.smashingmagazine.com/2009/02/11/the-big-php-ides-test-why-use-oneand-which-to-choose/ My main reason for switching from Notepad++ is that I'd like to be able to debug my code and set through it. I have followed the instructions about how to install xdebug from both the vendor http://xdebug.org/ and the netbeans web site. http://www.netbeans.org/kb/docs/php/debugging.html#gettingReady but to no avail. How is it done, has anyone else got debugging working in netbeans?

XAMPP + phpEclipse 调试php

和自甴很熟 提交于 2019-11-28 16:42:21
*前言 今天项目用到以前项目既存的php API ,为了调查以前项目的相关内容只有从头学习php了,可是光看代码很难理解啊,所以找个debug php的方法呗。网上找了相关的资料好多都是老早以前的了,而且含糊不清啊。在此把这个简单的php调试方法:XAMPP + phpEclipse的Xdebug方法记录下来。 *环境 〇Windows7 〇XAMPP Windows版 1.8.1 下载地址:http://www.apachefriends.org/zh_cn/xampp-windows.html#1787 〇phpEclipse Version: 3.0.2 下载地址:http://www.zend.com/en/community/pdt/downloads *安装 1,XAMPP的安装 在下载页面有:http://www.apachefriends.org/zh_cn/xampp-windows.html#1787 安装完成后请确认是否能启动apache。 2,phpEclipse下载后直接解压就可 *设定 1,在XAMPP中已经包含了Xdebug,所以只要稍微设置即可。 〇php.ini的修改:在文件的最后将以下内容【;】删除 ;zend_extension = "C:\xampp\php\ext\php_xdebug.dll"   ↓   zend_extension =

How can I get XDebug to run with PHPUnit on the CLI?

夙愿已清 提交于 2019-11-28 16:37:28
问题 I've tried running the following CLI command: phpunit -d xdebug.profiler_enable=on XYZTestCase.php but it just runs as normal. Can anyone point me in the right direction?? Thx! Here's the XDebug settings: xdebug xdebug support => enabled Version => 2.1.2 Supported protocols => Revision DBGp - Common DeBuGger Protocol => $Revision: 1.145 $ Directive => Local Value => Master Value xdebug.auto_trace => Off => Off xdebug.collect_assignments => Off => Off xdebug.collect_includes => On => On xdebug

Is it possible to use xdebug on Ubuntu?

丶灬走出姿态 提交于 2019-11-28 15:43:00
I am trying to debug some PHP code and wanted to download the XDebug debugger for PHP. All I see there is Windows binaries for downloading. Is it at all possible to use it on Ubuntu? Jarrod Nettles Execute the following commands in your terminal. Download Xdebug - you will need to follow alternate instructions if you don't have PHP5 working on your machine already. sudo apt-get install php5-xdebug The package should modify your INI file for you, but just in case you need to edit it yourself open it up and make the following modification - on Ubuntu its typically at /etc/php5/apache2/php.ini -

Can't connect PhpStorm with xdebug with Docker

拜拜、爱过 提交于 2019-11-28 14:45:36
I have the following Dockerfile: FROM php:7.0-fpm-alpine RUN apk add --update --virtual build_deps gcc g++ autoconf make &&\ docker-php-source extract &&\ pecl install xdebug &&\ echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_enable=1" >> /usr/local/etc/php/conf.d/xdebug.ini \ && echo "xdebug.remote_autostart=0" >> /usr/local/etc/php/conf.d/xdebug.ini &&\ echo "xdebug.remote_connect_back=1" >> /usr/local/etc/php/conf.d/xdebug.ini &&\ echo "xdebug.remote_handler = dbgp" >> /usr/local/etc/php/conf.d

How to make PHP set HTTP status code to 500 automatically in case of any error condition? (including those that cannot be handled by user)

自作多情 提交于 2019-11-28 11:58:55
问题 I am running Apache 2.2.15 with PHP 5.3.2, 'display_errors' disabled, 'display_startup_errors' disabled, 'log_errors' enabled. At my setup (so I consider it a norm), PHP aborts on fatal errors, which is good, and sets HTTP status code to 500 . Fatal errors include E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR and, probably, E_RECOVERABLE_ERROR (cannot trigger it myself, so can't easily check what happens). I think it is a good idea that it does set the code to 500, because I

php composer

巧了我就是萌 提交于 2019-11-28 11:53:21
2017年4月23日 11:14:09 星期日 PHP的composer可以类比 java的maven, node的npm, 或者linux centos的yum 开发时注意 尽量使用 compser install 命令, 这个命令根据lock文件保证了生产跟开发环境使用的插件是同一个版本, 如果使用 composer update 会使插件都为最新版本导致跟生产不一样, 对于一些依赖特定版本的程序会有问题 安装 1. 要先到国外的composer官网下载install文件 2. 用PHP执行该install 文件, 检查一下当前PHP配置, 没啥问题的话这个install 会自动下载composer.phar到当前目录下边 注: 这里提示了, 需要安装开启PHP的zlib扩展, 随后在运行的时候还会提示xdebug会影响效率, 而且不能以root权限去运行composer命令 3. composer.phar是PHP的一个包, 类似java的jar包, 它是个可执行文件, 文件第一行指明了需要PHP命令执行他自己, 因此可以直接运行该文件 先将它复制到PHP的bin下边, 保证可以被全局访问到, 然后命令行输入 composer 1 cp composer.phar /usr/local/web/php/bin/composer 2 3 composer -v 4 You