我正在使用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」文件夾下。我不明白爲什麼我的應用程序找不到它。再次感謝!
請把你的'gateway.php '看看它是否會拋出任何錯誤。 – 2010-07-06 20:48:31
另外,調用PHP腳本的部分Flex代碼將很好發佈。 – 2010-07-06 20:49:04