think tank forum

technology » debugging php

asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
any tips? the only two things I really do now are comment out various blocks of code and test certain stuff in simpler test files. I wish it would direct me to line numbers for syntax errors and stuff; it's really kind of obnoxious to debug.
asemisldkfj's avatar
17 years ago
link
asemisldkfj
the law is no protection
well what do you know, Google was helpful. I thought I had searched the web for this before and come up pretty much empty-handed. I found something about display_errors and log_errors and I've got both of those turned on now. now I have line numbers in Apache's error_log :).
nny's avatar
17 years ago
link
nny
M̮͈̣̙̰̝̃̿̎̍ͬa͉̭̥͓ț̘ͯ̈́t̬̻͖̰̞͎ͤ̇ ̈̚J̹͎̿̾ȏ̞̫͈y̭̺ͭc̦̹̟̦̭̫͊̿ͩeͥ̌̾̓ͨ
xdebug is a nice php module has some stack trace options.

also executing as a cgi with a wrapper to strace is fun.
lucas's avatar
17 years ago
link
lucas
i ❤ demo
error_reporting(E_ALL); // REMOVE FOR PRODUCTION


i just do that and it always gives me enough info to find the lines.