我正在使用 Flex 和 php 来开发我的项目。在我的本地机器上一切正常。但是,当我将文件上传到我的服务器 (godaddy.com) 时。加载我的 flex 应用程序时出现错误。
弹出的错误信息是
发送失败 channel.connect.failed.error Netconnection.call.Badversion: url: http://mydomail/folder/gateway.php
我已将 ZendFramewrok 文件夹上传到我的服务器中,并且 amf_config.ini 已配置。(webroot = http://mydomain ) 我不确定这里发生了什么。请帮忙。谢谢。
更新:我的 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();
如果我直接调用它,则来自 gateway.php 的错误。
警告:require_once(Zend/Loader/Autoloader.php)[function.require-once]:无法打开流:第 27 行的 /home/content/79/4687979/html/parkerList/gateway.php 中没有此类文件或目录
致命错误:require_once() [function.require]:无法打开所需的“Zend/Loader/Autoloader.php”(include_path='.:/usr/local/php5/lib/php: http://blackwheels.info// ZendFramework/library ') 在第 27 行的 /home/content/79/4687979/html/parkerList/gateway.php
佩卡。你说的对。gateway.php 是老鼠。但我仍然无法弄清楚出了什么问题。Zend/Loader/Autoloader.php 位于服务器根目录“ZendFramework/library”文件夹下。我不明白为什么我的应用程序找不到它。再次感谢!