B Seven
B Seven

Reputation: 45943

How to debug using WAMP?

I just installed WAMP on Windows XP. I have a simple PHP file that is crashing. I ran it from command line using php test.php.

What is the best way to debug php files? How do I display debugging info?

I looked at php.ini and it includes display_errors = On. Does this do anything?

I tried turning on XDebug from the PHP WAMP menu. This doesn't seem to do anything, besides restarting the server. Do I need to use this? How?

Thanks.

Upvotes: 1

Views: 16367

Answers (3)

TechHelix
TechHelix

Reputation: 101

I am using WAMPSERVER 2.4 on Windows 8 pro. I was using WAMP on localhost.

It appears that in my version of WAMP, the php.ini file had appeared as:

;error_log = "Z:/wamp/logs/php_error.log"

When in actuality,for me get the function error_log() to work properly, I wanted it to appear as :

error_log = "Z:/wamp/logs/php_error.log"

Upvotes: 1

Arpi Patel
Arpi Patel

Reputation: 785

As much as i know about PHP and WAMP.I don't think there is any special debugging option available in this.for the debugging you need to print the answer using echo and exit function wherever in your code you feel the error may posible. The other option is, you need to use software which provide debugging facility such as eclipse with php.

Upvotes: 2

Kristiono Setyadi
Kristiono Setyadi

Reputation: 5643

You can look at the log at c:/wamp/logs/php_error.log. If you are not sure whether your PHP log is being redirected here, check your php.ini file and search for a line like this:

;error_log = "c:/wamp/logs/php_error.log"

You may want to remove the comment on this line.

Upvotes: 3

Related Questions