-
Funkalicious
Debugging php
Hi guys,
I'm taking my first stabs at combining AS3 with PHP and MySQL. I've queried using AS3 and recieved data and all is working fine. What my problem is, is that my workflow at the moment is:
- write the php script
- test the php script with hardcoded values
- replace hardcoded values with $POST values
- test the script by letting AS3 post values to it.
This is somewhat cumbersome, as I only get error messages concerning the AS3 when debugging the AS3 and PHP communication. I'm using Netbeans as an IDE, but this seems to only debug when purely running in PHP. I'd like to get errors from PHP too. Is there a some kind of debugger that can listen to PHP files while it isn't calling them itself, or should I write some kind of logger function in PHP? If somebody has any other suggestions to make debugging less of a chore I'm glad to hear your solutions.
Thanks in advance!
-
I'm not sure what your setup is like, but if you are running PHP on a Mac or a linux machine, you can configure it to write all errors to a log file. You can monitor the log file with a simple command. Open a terminal window, locate the log file (let's assume it's located at /path/to/log/file.txt), and type
Code:
tail -f /path/to/log/file.txt
Then you can see all the php errors as they occur.
That is not really as convenient as using a fancy IDE which lets you set breakpoints and inspect values when an error occurs, but it will work in a very wide variety of situations.
-
Developing For Dunkets
Also, it gets mentioned a lot but amfphp has an as3 browser that will help you debug. It reads your service (php class) and tells you the methods and well as lets you run test input and receive errors back from php/mysql.
Or, if your going doing the remoting just with as3 the Responder class has an error response that you can use to trace out the errors:
PHP Code:
var r:Responder = new Responder(good, bad); function bad(response:Object){ trace(response); }
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|