First of all, does “bitcoind getinfo” work?
Second, try to grab the attempt that jsonrpcclient.php makes with netcat (might have to install it first):
- Stop bitcoind
- netcat -l 8332
- Run your client code with a modified (insecure) username and password
- Ctrl-C netcat and post the output