xdebug

在visual studio之中开发PHP项目

强颜欢笑 提交于 2019-12-03 11:42:29
说道 开发工具,有些人用IDE,有些人用 编辑器开发PHP,这类的培训机构也多。 现在,三层、mvc之类的思想遍地开花,使得代码和html得以分离,加之随着开发的分工和项目的增大,一个好的IDE能为编码工作提供了许多的便利。就像开发java用eclipse,.NET用 一样,开发PHP也很需要一种这样的利器。常见的php的IDE有Eclipse,NetBeans,Zend studio,vs.php等。这几个我也都用过,其中Eclipse,NetBeans,Zend studio都有win和linux的版本,也都集成了像代码感知、调试、设计、片段等的功能,都用过一阵子后发现,在windows下,个人感觉还是vsiual studio+vs.php最是好使。主要的原因就是速度。 vs的速度真的是快其他的IDE太多了,无论是从启动速度还是使用过程中资源的耗用都要好于其他3款,毕竟是微软自家的东西。 现在介绍用visual studio开发PHP visual studio PHP 以插件形式安装到vs, 最新版本 2015, 到官网下载安装即可。默认是30天试用,可以搭配visualstudio express。安装以后,在visual studio的新建项目里就会多出来php的项目。 图: 当然也支持一个解决方案,多个项目 visual studio.php在启动的时候

xdebug not loading. not found in phpinfo() after apache restart

依然范特西╮ 提交于 2019-12-03 11:21:22
问题 I've been scouring every resource I could find, but came up empty. I get the dreaded "Waiting for Connection" message in NetBeans 6.9 when I start a debug session. After much reading, most folks are able to get phpinfo() to display that it loaded the xdebug module. Not so with me. I downloaded the source through SVN using this call svn co svn://svn.xdebug.org/svn/xdebug/xdebug/trunk xdebug I switched to the xdebug directory and then ran phpize on the source sudo /Applications/MAMP/bin/php5

Increase var_display_max_depth for xdebug

孤者浪人 提交于 2019-12-03 11:12:46
问题 I recently installed xdebug on my ststem and wanted to increase xdebug.var_display_max_depth from 3 to 10. How can I go about doing that? 回答1: There are two ways to do that. You can edit this value locally and globally too. Local setting (" Local value ") in your own PHP file: <?php ini_set('xdebug.var_display_max_depth', '10'); // here comes your code... ?> Global setting (" Master value ") in php.ini : First locate your php.ini file. In phpinfo() , you can get to know where it is from

XDebug could not connect to client

試著忘記壹切 提交于 2019-12-03 10:35:10
I am trying to debug with NetBeans Mac locally. This is my php.ini [xdebug] xdebug.default_enable=1 xdebug.remote_enable=1 xdebug.remote_handler=dbgp xdebug.remote_host=localhost xdebug.remote_port=9000 xdebug.remote_autostart=1 xdebug.remote_log="/Applications/MAMP/logs/xdebug.log" xdebug.idekey="netbeans-xdebug" zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so" This is what I had been getting in xdebug.log I: Connecting to configured address/port: localhost:9000. E: Could not connect to client. :-( I try changing the port to 9001 and

Docker - port prevents listening

匿名 (未验证) 提交于 2019-12-03 10:24:21
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to setup xdebug integration on my docker-based setup. I am using Docker for Mac 1.12.0-rc2-beta17 with the "native" docker machine I have a container, with xdebug installed, exposing port 9000 and mapping it to the port 9000: $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 6950c2a2b05d app "/usr/bin/supervisord" 9 minutes ago Up 9 minutes 0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:9000->9000/tcp, 0.0.0.0:2222->22/tcp app_1 When I'm trying to use PhpStorm to listen to the port 9000 for debug connections, I

phpstorm xdebug with a symfony2 project

半城伤御伤魂 提交于 2019-12-03 10:20:11
问题 I am trying to debug a symfony2 application with xdebug and phpstorm. My local development environment is Ubuntu 14.04 with apache2 and Xdebug version is 2.2.7 I have this working on another php (not symfony2) projects with the following guides: https://www.jetbrains.com/phpstorm/help/configuring-xdebug.html https://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm When I execute the bookmarlet to set the cookie and start debugging

XAMPP 1.7.3, Eclipse PDT &amp; XDebug - Debugging a PHP web page in Eclipse never stops at breakpoints

匿名 (未验证) 提交于 2019-12-03 09:52:54
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: My development web server is currently a XAMPP 1.7.3 on my localhost (Win XP). I just set up my Eclipse 3.6 PDT with XDebug . It works fine, if I debug a file as a "PHP script", but when it comes to debugging it as a "PHP web page", XDebug ignores the breakpoints completely. Only a manually inserted xdebug_break() inside the code stops the debugger. This isn't very useful, if you want to use conditions with Eclipse's breakpoints. Here my config: php.ini: zend_extension = "C:\xampp\php\ext\php_xdebug.dll" xdebug.remote_autostart=1 xdebug

How to change background color of line highlighting during debug process in Netbeans?

夙愿已清 提交于 2019-12-03 09:38:17
how to change background color of line highlighting during debug process in Netbeans? Tried to change "Highlight Caret Row". No success. It only changes bg color of line where cursor blinks, but not debugging line: confiq Annotations Tab Try the "Fonts & Colors" > "Annotions" tab. Restart NetBeans (or re-open editors) for changes to take effect. Open Tools->Options->Fonts&Colors then go to "Annotations" tab. Color options for debug line in "Current Program Counter" item. It is works for me. JonK There is a breakpoint selection in the Annotations tab. Tools -> Options -> Fonts & Colors ->

In php , is there a way to trace a variable?

折月煮酒 提交于 2019-12-03 09:14:58
I have this variable in a big php script that I want to trace back to where/when and what value it was instantiated. Is there a function/api or debugging techniques to do this? If you're using PHPStorm you can set breakpoints and inspect the values of variables. http://blog.jetbrains.com/phpstorm/2013/12/just-in-time-debugging-and-php-exception-breakpoints-with-phpstorm-and-xdebug/ You'll need xdebug installed as well. You can use debug_print_backtrace() function. http://php.net/manual/en/function.debug-print-backtrace.php <?php function f1() { f2(); } function f2() { f3(); } function f3(){

Why does foreach increase refcount by 2 instead of 1?

心已入冬 提交于 2019-12-03 08:58:43
NikiC stated in another thread : Right before [a foreach] iteration the $array is "soft copied" for use in foreach. This means that no actual copy is done, but only the refcount of the zval of $array is increased to 2. However, my test code is showing a different result: $array = array(0, 1, 2); xdebug_debug_zval('array'); // refcount=1, is_ref=0 // so far so good foreach ($array as $key => $value) { xdebug_debug_zval('array'); // refcount=3, is_ref=0 } // why is refcount 3 instead of 2? Just by looking at the code, we can see at most two array variables. Why is refcount 3 ? Why isn't refcount