Welcome, Guest. Please login or register.
Did you miss your activation email?
05/23/12, 01:20
Home Help Search Login Register
News: Parsley Flex framework review featuring quiz application, in our Flex frameworks series
Flex SDK 4.5 mobile roadmap: begin with your mobile development
Swiz Flex framework review featuring quiz application
New homepage we release our new Homepage, take a look ...

+  Flash-db
|-+  Server side Scripting and Database Support
| |-+  Flash Remoting with AMF (Moderators: Flash-db, Musicman, Jorge Solis, papachan, nothingGrinder)
| | |-+  General errors with AMFPHP and fixes
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: General errors with AMFPHP and fixes  (Read 22198 times)
Flash-db
Administrator
Systems Administrator
*****
Posts: 1867



View Profile WWW
« on: 08/19/03, 01:26 »

Please use this thread to post tips on getting AMFPHP to work correctly.

To Start it off here is some general info from amfphp.org:

NetConnection.Call.BadVersion error
A very common issue is to get a "NetConnection.Call.BadVersion" answer in your NetConnection debugger. There are various causes for this failure; the general reason is that the client doesn't receive a correctly formatted AMF message. This is generally due to installation errors, parse errors in your code, or any number of other reasons. The most common are listed below.
  • The AMFPHP installation was not correctly performed; the gateway cannot find the libraries. You can check this by pointing your browser at your gateway URL, for instance: http://host/flashservices/gateway.php. If any PHP errors appear, the gateway is not correctly installed. Perform the AMFPHP installation correctly.
  • Your service has parse errors. Point your browser at the URL of your services, for instance: http://host/flashservices/services/examples/ExSrv.php to see what parse errors are prevalent in your code.
  • Your script is pushing data into the output buffer. Check that your script has no leading OR trailing newlines or spaces and that your script isn't outputting any data with an echo, print, or other similar control structure or function as this will result in sending this data to the client, before the actual AMF message is sent.
  • If you work under Windows or Mac OS X, your editor may be creating incompatible line breaks. Windows terminates every line with CRLF (\n\r); some applications in Mac OS X terminate lines with the standard Mac line ending (chr(13)) plus a CR (\n). We suggest the following editors for Windows users:

Macromedia DreamWeaver MX (Windows and Mac OS X) with the preferences set to use LF (Unix) line breaks.
vi (Windows and Mac OS X)
EditPlus in combination with Flush
UltraEdit in combination with syntax highlighting
SciTE|Flash .[/*]

[/list]



From the above issue's: One of the biggest to watch out for is the 'pushing data into the output buffer'.  This means that if you have any space (at all) or any line breaks outside of your php tags ie <? ?> your script will break because of corrupted amf.  This is a difficult one to catch at when first using amfphp because error messages will not be returned.


FOR PHP 5 users

Exception problem
You must to rename Exception class and all its calls so something else (Amf_Exception in my case)
Then all works fine.
Using trigger_error() breaks the output, just giving a Badversion. Anyway Exceptions.php sets the set_error_handler to reportExceptions ... should check better this.
Using throwException (or throw Amf_Exception now) needs a reference to the body that I'm not sure how to build (it's a member in ClassLoaderAction.php and SecurityAction.php, the two classes I see are using exceptions)

See http://www.flash-db.com/Board/index.php?board=24;action=display;threadid=10244

Constructor problem (check first if works with previous fix) Check http://sourceforge.net/mailarchive/message.php?msg_id=8907838

AMFPHP: Multiple service calls problem: see http://www.flash-db.com/Board/index.php?board=19&action=display&threadid=10690
« Last Edit: 04/25/05, 03:32 by Jorge Solis » Logged

-Jeff.
Chris
Server what's that
*
Posts: 4



View Profile Email
« Reply #1 on: 09/15/04, 11:56 »

Hopefully this will help someone somewhere.

If you get the "NetConnection.Call.BadVersion" and none of the above solutions work, make sure you have php installed with xml.  It's pretty common, but Mandrake doesn't include it by default.  I spent about 8 hours trying to get it to work, then as soon as I posted the same files to my live webserver (Red Hat) everything worked fine.
Logged
Jorge Solis
Administrator
Systems Administrator
*****
Posts: 14600


View Profile
« Reply #2 on: 12/14/07, 06:42 »

Updated comon errors on amfphp site: http://amfphp.org/docs2/debugging.html

Jorge
Logged

Pages: [1] Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!
anything