AMF-PHP multiple method calls

If you’re working with Flash Remoting using AMF-PHP you might have encountered some problems in the latest release with doing multiple method calls. I’ve been browsing the mailinglist and came across a solution by Justin Watkins that fixes this problem.

You can download an updated version of “Executive.php” and use that to replace the old one (flashservices > app), you’ll also be required to do a little tweak to your “gateway.php” file:

$gateway->setBaseClassPath($_SERVER['DOCUMENT_ROOT'].“flashservices/services/”);

Those two changes should do the trick!

4 Comments

  • January 10, 2004 - 1:23 am | Permalink

    I believe I am having the problem you have described. I have movie clip A, and when i click the link that plays it, it opens a connection to the gateway, then recieves the results and creates some images and text, etc. then when I click a link that points to movie clip B which does the same type of thing, no results are returned. However if I first go to the movie clip B it works, and then when i go to movie clip A it doesn’t work. So whichever one I go to first is creating an instance of the method call as described in the Executive.php file. I tried your fix but i get an error in Netdebugger stating that DOCUMENT_ROOT is not a valid index. So I looked into setting doc_root in my php.ini file, but it got to complicated, saying i had to change that, and some other path, and copy php4.dll, and all this crap. So if you know how to make DOCUMENT_ROOT work I would be greatful for a response. I’ve been bashing my brains over it for two days and your answer via Justin Watkins seems to be the most relevant solution. I tried to see the mailinglist but after I registered at the site I clicked the link to the amfphp-general list and it said it didn’t exist so if you have a copy of his full solution or know what it was that would help as well. thanks for your time, david

  • January 10, 2004 - 1:29 am | Permalink

    Hi David, from what I’ve just read it looks like PHP isn’t processing the $_SERVER['DOCUMENT_ROOT'] properly.

    Have you tried accessing the gateway.php through your browser to see if that returns an error?

  • January 10, 2004 - 4:27 am | Permalink

    yes the page runs fine, i also tested my current configuration without the new Executive.php file and without using $_SERVER['DOCUMENT_ROOT'] on a sample program , the parkservices example from amfphp at sourceforge’s website and it works , but my flash file has seperate movie clips where as theres only has one. so still no progresss as of yet. if you have any other suggestions or codes requests to analyze please let me know, again thanks for your time. david

  • April 21, 2004 - 7:33 pm | Permalink

    this just saved my life. thank you. amfphp has a really bad error reporting and was trying to fix the “php script error” for hours…

  • Comments are closed.