Gibbs
Gibbs

Reputation: 22956

Debugging PHP codes

I am following this tutorial

STEPS

Downloaded Xdebug - PHP VC 11 64 bit [Didn't download TS version - ]

My php is 5.6.11 vc 11

Added zend extensions with right dll path

Started server. Zend extension is added. Checked with phpinfo()

Downloaded Eclipse PDT

Opened Eclipse and created new project and given path to my files

Localhost server so didn't change PHP->Servers

Debug configurations
   Changed server to XDebug
   Added a file to debug

Started the server. It opens in mozilla [I changed default web browser to mozilla in eclipse]

But it didn't stop at my breakpoints

<?php

$x = 2;
$y = 5;
$z = $x + $y;
echo $z;

?>

Did I miss any step? Or is there any other way to achieve debugging PHP? Any Suggestions?

Upvotes: 0

Views: 98

Answers (1)

RiggsFolly
RiggsFolly

Reputation: 94642

Make sure you have the correct version of the XDEBUG dll to match your Apache/PHP installation.

If you have PHP installed as an Apache module you need the Thread Safe XDEBUG dll. If you have PHP installed as CGI/FastCGI then you want the Non Thread Safe XDEBUG dll.

Its a good idea to use the XDEBUG Wizard

That will tell you exactly what to modify in your php.ini and which dll you should download.

Beware of old tutorials, they may suggest using the old and now defunct zend_extension_ts= when you should use zend_extension=

Also on windows systems use the unix forward slash and not the dos backslash in the path to the XDEBUG dll like so :-

zend_extension="C:/server/php/ext/php_xdebug-2.3.3-5.6-vc11-x86_64.dll"

Upvotes: 2

Related Questions