Michiel
Michiel

Reputation: 8103

Can't configure Xdebug

I've installed PHP 5.3.8 on my localhost and I tried to configure Xdebug, but for some reason, Xdebug doesn't seem to work. I've added following lines to my php.ini file:

zend_extension = C:\Server\PHP\5.3.8\ext\php_xdebug-2.1.3-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”

And of course, the file in the zend_extension path is exists. And I also have tried restarting my Apache.
Is there a specific type of Xdebug for every version of PHP or is this just a matter of a bad configuration?

EDIT:
I've tried every 2.1.3 and 2.1.2 dll available on the Xdebug site, but none of them seems to work...

EDIT 2: Ok, great, I just got the latest Xdebug version working, but my var_dump's still look awful... Here is what they look like:

array(3) { [0]=> string(4) "text" [1]=> string(4) "node" [2]=> string(6) "blabla" }

But they used to look like this:

array(3) 
    0 => 'text' string(4) 
    1 => 'node' string(4)
    2 => 'blabla' string(6)

How do I get them to look like this?

Upvotes: 1

Views: 2299

Answers (3)

Derick
Derick

Reputation: 36784

If your var_dump looks "awful" then you need to set html_errors=1. Xdebug respects PHP's normal error reporting settings and (sadly) in PHP 5.3 that default now has html_errors=0. Simply set it back to 1 in php.ini.

Upvotes: 2

deed02392
deed02392

Reputation: 5022

Xdebug has a fantastic phpinfo() output parser which determines exactly what version of Xdebug you need and even gives you personalised instructions based on this. Simply visit:

http://xdebug.org/find-binary.php

and you'll be up and running in no time.

Upvotes: 3

Al_
Al_

Reputation: 1511

Of course the xdebug version must be compatible with the php version. Yours look well (you can check it in the download page: enter link description here).

Next, check the Zend Engine is running with xdebug. phpinfo() must return something like:

This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
    with Xdebug v2.2.0-dev, Copyright (c) 2002-2011, by Derick Rethans

If you don't see the line "with Xdebug..." the problem is on the dll. If you see that line, xdebug is running ok. Then the problem comes from the client side, maybe due to a configuration problem.

Upvotes: 1

Related Questions