amfphp1.9与php5.3.X版本不兼容

damned,昨天花了一天时间来调试,amfphp在liunx系统php5.3.X的版本下,一直会出错。

打开gateway.php正常,再打开services就报错:

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

网上搜到无数此情况,只是没有一个有能解决的办法。。。恼火啊。


后来看到这里才晓得,amfphp与php5.3.X搭配就是有问题。只好降格成php5.2.X,一切ok。


http://blog.csdn.net/gavin_guo/archive/2010/03/24/5410378.aspx


I don’t get PHP 5.3.1 working with amfphp 1.9.

I always got the following error: 
(mx.rpc::Fault)#0 
errorID = 0 
faultCode = “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)#1 
code = “NetConnection.Call.Failed” 
description = “HTTP: Failed” 
details = “http://localhost/amfphp/gateway.php” 
level = “error”

I don’t know what happens. And when I look into the apache error.log, I got: 
[Mon Mar 22 20:53:05 2010] [error] [client 127.0.0.1] File does not exist: D:/Program Files/Apache/htdocs/amfphp/browser/history.htm, referer:http://localhost/amfphp/browser/ 
[Mon Mar 22 20:53:05 2010] [error] [client 127.0.0.1] File does not exist: D:/Program Files/Apache/htdocs/favicon.ico

After I googling, there is no good solution on this.  Anything relevant for the root cause? 
And meanwhile, I am using: Windows XP with SP3 and Apache 2.2.1

Solution finally identified as follows:

- Downgrade the PHP version to 5.2.X and then it works perfectly.

- PHP Version 5.3.x seems not compatible with Amfphp 1.9.

在排查问题的时候也看到了大家的一些其他方面的讨论,也一并放在这里了。

后来逛到天地会后发现一篇 关于AMFPHP1.9错误的处理方法:

(以下内容转自天地会- 后台技术讨论区 » 关于AMFPHP新版一些问题解决办法)

AMFPHP 1.9新版问题修改

1、Flash环境下访问方法失败,而自带调试SWF正常,修改amfphp\gateway.php如下内容:

        if(PRODUCTION_SERVER)
        {
                //Disable profiling, remote tracing, and service browser
                $gateway->disableDebug();
                // Keep the Flash/Flex IDE player from connecting to the gateway. Used for security to stop remote connections. 
                //$gateway->disableStandalonePlayer();
        }

2、访问ByteArray对象出错,修改amfphp\core\amf\io\AMFSerializer.php如下内容:

        function writeAmf3ByteArray($d)
        {
                $this->writeByte(0x0C);
                //$this->writeAmf3String($d, true);
                $this->writeAmf3ByteArrayBody($d);
        }

另需要在写PHP代码时,将AMFPHP的AMF设置为AMF3,Flash设置无效的,代码为$GLOBALS['amfphp']['encoding'] = 'amf3';
或修改amfphp\core\shared\app\Globals.php内容中的$amfphp['encoding'] = "amf0";为$amfphp['encoding'] = "amf3";

 

 

 

 

你可能感兴趣的:(apache,PHP,XP,Flex,Flash)