I’m using Zend debugger and PDT for PHP development and have run into an issue debugging Facebook PHP. I’m using the example.php in the SDK to test. The application runs fine from Facebook, but I’m having trouble setting breakpoints. I have tried:
-
Run from Eclipse – Application does not run as expected. I’m getting null values for
$_SERVER['HTTP_HOST']and$_SERVER['REQUEST_URI']although I can set breakpoints and debug. -
Run from Facebook – the application runs as expected, but ignores breakpoints.
I’m using DynDNS for my DNS lookup and have changed my host file to redirect the URL to my local host.
I’m not even sure if #1 is possible, but it would be nice to use Eclipse and not have to refresh a web page as in #2. Any ideas?
Try defining a local domain for your local server in the hosts file of your OS (in Windows you can find it in
C:\Windows\System32\drivers\etc).For example, if your server runs on
localhost, add the row:On the Facebook developers site (in your application settings), set the domain of the application to
mydomain.comoflocal.mydomain.comand for the canvas URL (if you work within facebook canvas) set the local URL of your application.For example:
Last, change the Debug URL of the specific page (in Eclipse’s menu Run* → Debug Configuration) to the URL of the canvas (for example,
http://apps.facebook.com/my_fb_app/).