views:

95

answers:

2

I am not an expert in PHP, still learning it. I'd like some hints on how to troubleshoot problems.

Recently I installed PHP 5.2.9 on Vista+IIS7 (phpIsapi). I ran a script that did an opendir()/readdir(). This script ran just fine on 5.2.0. On v5.2.9, it failed but I got no indication of the source of the problem.

I banged around in the dark to troubleshoot it, finally trying different directories and narrowing it down to a directory perms issue. More banging around to figure out which user needed perms. Though the page runs as Network Service, the user that needed perms on the dir was IUSR. And it needed RX perms on the entire traversal tree. Who knew?

I also worked with a bunch of COM components. Some of them worked, some did not. They often failed with "No error". Again it was bumping around in the dark until I solved the problem.

I tried error_reporting(E_ALL | E_STRICT) but that gave me nothing more useful. I know this can't be the way that people do troubleshooting as they develop on PHP.

Any hints you can provide on efficiently working through minor issues as they come up?

+1  A: 

http://www.xdebug.org/

whichdan
A: 

Well, my answer is: no, there's no good way.

Cheeso