Home > AMFPHP, Flash Platform > apache mod_security oddity in AMFPHP

apache mod_security oddity in AMFPHP

April 3rd, 2008

An AMFPHP user gave me a run for my money on debugging an error on a new server. Come to find out mod_security can play a little havoc on AMFPHP and even though the gateway.php file executes correctly. When you open up the amfphp/browser you will get the following error which will also be your fault event in your application.

(mx.rpc::Fault)#0  errorID = 0faultCode = "Client.Error.MessageSend"faultDetail = "Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed"faultString = "Send failed"message = "faultCode:Client.Error.MessageSend faultString:'Send failed' faultDetail:'Channel.Connect.Failed error NetConnection.Call.Failed: HTTP: Failed'"name = "Error"rootCause = (Object)#1code = "NetConnection.Call.Failed"

description = "HTTP: Failed"

details = "http://somedomain.com/amfphp/gateway.php"

level = "error"

when you call a service it gives the following error.

403 Forbidden

Forbidden

You don't have permission to access /amfphp/gateway.php on this server.

Additionally, a 404 Not Found

error was encountered while trying to use an ErrorDocument to handle the request.

Apache/1.3.39 Server at domainname.com Port 80

So if you are seeing this error when you try and connect to your gateway in charles / service capture look at a phpinfo page and see if mod_security is installed. If it is then in order to fix this error you need to create an .htaccess file in the amfphp/gateway.php directory and place the following content in it.

<ifmodule>SecFilterInheritance Off </ifmodule>

Hope that helps. If anyone knows more about this module please let me know what really is going on as I would love to understand why a security module is stopping amfphp.

AMFPHP, Flash Platform

  1. April 11th, 2008 at 15:59 | #1

    I ran into the same issue when using AMFPHP with Adobe AIR beta 3. The “user-agent” of the http request was being rejected by the mod_security filters / rules set up on the remote server. Here’s a link to my post about this

    http://dluminosity.com/blog/2008/02/13/403-forbidden-error-with-adobe-air-app/

  2. December 19th, 2009 at 05:46 | #2

    Hello and thanks in advance.
    I have followed your screen-casts and i believe you do an amazing job, got me started on AMFPHP/Flex on the fly. I am having a problem. Seems that .connect() doesnt throw a netStatus event so there is no way you can monitor the connection. The connection IS successful but no event is deispatched. Any ideas?

    Thanks

  1. No trackbacks yet.