PDA

View Full Version : Failproof solution to the amfphp tutorial on as.org


wyattk
04-28-2004, 03:14 PM
All you need to do is install the old version (http://prdownloads.sourceforge.net/amfphp/amfphp-0.5.1.zip?use_default=umn). I struggled with it for DAYS and DAYS until I found a thread saying to use version 0.5.1. I downloaded and installed it right where the new one was on my server and voila, every example worked without a hitch.

There is something very wrong with the new version, and I do not recommend learning on it. Stick with 0.5.1 and you won't have a problem.

cheers,
wyattk

destr3
04-28-2004, 06:10 PM
Hi wyattk,
I'm not sure if you're talking about the same problem that I was having after installing the newest version of AMFPHP - but when I went through the "talkback" example, I kept getting errors like this:

.....code: 256
.....description: "This user is not does not have access to returnString"
.....details: "/yourserverpath/flashservices/app/Executive.php"
.....level: "User Error"
.....line: 295
As it turns out, the latest AMFPHP version is trying to support Flash Remoting's service.setCredentials() method, in order to authenticate a user. If you don't need to authenticate the user, you can just disable it by going to your service (talkback.php), and comment out the "roles" items in your methodTable.

If you DO need to authenticate a user, however, check out the examples that came with the latest version of AMFPHP (amfphp-0.9.0/sources/examples/basic/).

(thanks to S.Webster on DynamicFlash for the heads up - http://www.dynamicflash.co.uk/b2commentspopup.php?p=18&c=1)

wyattk
04-28-2004, 07:04 PM
hmm..i never encountered that error, mostly i think because I couldn't get that far. It would fail to connect to the server when i tried to access my simple_gateway.php file, and wouldn't reply any data to the flash file. Those errors seemed to come up relatively frequently as I browsed various amfphp forums, so I thought it might be helpful to supply the solution to that error.

destr3
04-28-2004, 09:08 PM
hrmm...that's strange. Maybe it's having a problem with the relative path. Try this in your simple_gateway.php (and make sure you change the path in the flash file to reflect your server)?


<?php

include "../../flashservices/app/Gateway.php"; // or wherever your Gateway.php is

$gateway = new Gateway();
$fbaseClassPath = $_SERVER['DOCUMENT_ROOT'] . "/flashservices/services/";
$gateway->setBaseClassPath($fbaseClassPath);
$gateway->usePearSOAP(false); // I'm using nuSoap
$gateway->service();

?>


Does your output window give you any more verbose messages? Or your NetConnection Debugger (Window->Other Panels->NetConnection Debugger)

arckid
05-02-2004, 02:14 PM
you need to set credentials i guess. you forgot that ...

xdissent
05-28-2004, 10:19 PM
the path was wrong. atleast for my setup. simple_gateway.php should have the following...
$fbaseClassPath = $_SERVER['DOCUMENT_ROOT'] . "/test_remoting/services/";
$gateway->setBaseClassPath($fbaseClassPath);


im pretty sure this is following the instructions... i dont know why the default simple_gatway.php said just "services/" who knows.

xdissent
05-28-2004, 11:10 PM
oh... this works too.....

$gateway->setBaseClassPath("./services/");