The initial testing on a PayPal IPN listener can be tricky. I just wrote a blog post on this very subject: PayPal IPN with PHP.
In a nutshell...
Before you even try to get your listener working with PayPal IPN, make sure it is setup to log errors and focus your attention on error handling every scenario you can think of. If you setup your listener such that hard errors are logged, and proper IPN responses are emailed, then you can isolate the problem to your own IPN code versus a PayPal configuration or missing field.
Use the IPN simulator in the PayPal sandbox. Make sure your IPN listener properly handlers the IPN first. Then you can begin doing sandbox transaction testing. If you know your IPN script works, and it doesn't when you're doing sandbox testing, you can assume that your seller account is not setup with an IPN listener or you are not passing notify_url properly.
If you use PHP-PayPal-IPN then it will handle the post back to paypal and let you focus on what to do with verified IPNs (insert in datatabse, activate membership, fulfill orders, etc.). If you do use this class to implement your listener and have any problems with it connecting to PayPal, let me know and I'll help you troubleshoot the issue.