Flex/Zend通道连接失败错误
我正在使用Flex和PHP来开发我的项目。一切工作在我的本地机器很好。但是,当我将我的文件上传到我的服务器(godaddy.com)时。加载我的Flex应用程序时出现错误。Flex/Zend通道连接失败错误
弹出错误信息是
发送失败 channel.connect.failed.error Netconnection.call.Badversion:网址: http://mydomail/folder/gateway.php
我有我的上传文件夹ZendFramewrok到我的服务器和amf_config.ini已配置。 (webroot = http://mydomain) 我不确定这里发生了什么。请帮忙。谢谢。
更新:从如果我直接调用它gateway.php 我gateway.php
<?php
ini_set("display_errors", 1);
$dir = dirname(__FILE__);
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "$dir/amf_config.ini";
//default zend install directory
$zenddir = $webroot. '/ZendFramework/library'; //I did upload the ZendFramwork folder
//Load ini file and locate zend directory
if(file_exists($configfile)) {
$arr=parse_ini_file($configfile,true);
if(isset($arr['zend']['webroot'])){
$webroot = $arr['zend']['webroot'];
$zenddir = $webroot. '/ZendFramework/library';
}
if(isset($arr['zend']['zend_path'])){
$zenddir = $arr['zend']['zend_path'];
}
}
// Setup include path
//add zend directory to include path
set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();
// Load configuration
$default_config = new Zend_Config(array("production" => false), true);
$default_config->merge(new Zend_Config_Ini($configfile, 'zendamf'));
$default_config->setReadOnly();
$amf = $default_config->amf;
// Store configuration in the registry
Zend_Registry::set("amf-config", $amf);
// Initialize AMF Server
$server = new Zend_Amf_Server();
$server->setProduction($amf->production);
if(isset($amf->directories)) {
$dirs = $amf->directories->toArray();
foreach($dirs as $dir) {
// get the first character of the path.
// If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path
$length = strlen($dir);
$firstChar = $dir;
if($length >= 1)
$firstChar = $dir[0];
if($firstChar != "/"){
// if the directory is ./ path then we add the webroot only.
if($dir == "./"){
$server->addDirectory($webroot);
}else{
$tempPath = $webroot . "/" . $dir;
$server->addDirectory($tempPath);
}
}else{
$server->addDirectory($dir);
}
}
}
// Initialize introspector for non-production
if(!$amf->production) {
$server->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
$server->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
}
// Handle request
echo $server->handle();
错误。
警告:require_once(的Zend /装载机/ Autoloader.php) [function.require一次]:未能打开流:在 /家庭/内容没有这样的文件或目录/4687979分之79/ HTML/parkerList/gateway.php第27行
致命错误:require_once()[function.require]:无法开口需要 '的Zend /装载机/ Autoloader.php' (include_path中=”:在/ usr /本地/ PHP5/lib中/ php:http://blackwheels.info//ZendFramework/library') in /home/content/79/4687979/html/parkerList/gateway.php on line 27
Pekka。你是对的。 gateway.php是老鼠。但我仍然无法弄清楚什么是错的。 Zend/Loader/Autoloader.php位于服务器根目录“ZendFramework/library”文件夹下。我不明白为什么我的应用程序找不到它。再次感谢!
设置此我有同样的问题,我在指令修正路径解决它“需要”或“require_once”。
在Windows本地主机上运行正常,但在上传到我的linux服务器后,由于引导斜杠导致所有需要的路径都需要更新。Linux的理解不同的看法;)
基于对PUKKA您的意见,您的问题将通过改变线路27来解决,以
require_once $zenddir. '/Zend/Loader/Autoloader.php';
希望这有助于有人在同样的情况就像我们。
BTW dittonamed是正确的,这些工具真的很棒,我只是用不同的(查尔斯或Wireshark的 - 这是一个有点重),但不会有没有他们,没有任何进展;)
我敢打赌,它的gateway.php
是抛出一个错误,并歪曲你的Flex应用程序预期的结果。你能直接拨打gateway.php
吗?
谢谢佩卡。我无法直接调用gateway.php。它通过Flex应用程序。我只是把我的gateway.php代码放在这里。谢谢回复。 +1 – FlyingCat 2010-07-06 20:48:21
@Jerry难道你不能直接调用它,只是为了看看它是否有效,没有任何明显的致命错误等? – 2010-07-06 20:49:52
这是服务Capture是方便 - 它会告诉你的背部和使用Flex/PHP来回沟通,如果它的崩溃 - 也将显示您的正常PHP跟踪
它看起来像您的include_dir设置不正确。你说Autoloader.php
在ZendFramework/library
。为了找到这个,你需要设置PHP来查找包含文件的目录。
你是一个拯救生命的人! – 2011-04-01 11:59:35
请把你的'gateway.php '看看它是否会抛出任何错误。 – 2010-07-06 20:48:31
另外,调用PHP脚本的部分Flex代码将很好发布。 – 2010-07-06 20:49:04