A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Debugging php

  1. #1
    Funkalicious TOdorus's Avatar
    Join Date
    Nov 2006
    Location
    Nijmegen, Netherlands
    Posts
    697

    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:

    1. write the php script
    2. test the php script with hardcoded values
    3. replace hardcoded values with $POST values
    4. 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!

  2. #2
    Senior Member
    Join Date
    Apr 2004
    Location
    LA
    Posts
    349
    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.
    Write multiplayer games with FlashMOG 0.3.1
    Try the MyPlan Salary Calculator

  3. #3
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    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(goodbad);
    function 
    bad(response:Object){
    trace(response);

    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center