Apache flex 频道.安全.错误…错误#2048

Apache flex 频道.安全.错误…错误#2048,apache-flex,flex4.5,Apache Flex,Flex4.5,我最近升级到Flash Builder 4.5 for PHP,并尝试将发布版本上载到我的remoteserver。当我尝试从应用程序进行php调用时,会出现以下错误: Send failednChannel.Security.Error error Error #2048 url: 'http://localhost/my_php/public/gateway.php' 发布版本在我的本地主机上运行良好。我所有的php服务调用都在我的远程主机上。以下是我的远程主机的结构: /my_direc

我最近升级到Flash Builder 4.5 for PHP,并尝试将发布版本上载到我的remoteserver。当我尝试从应用程序进行php调用时,会出现以下错误:

Send failednChannel.Security.Error error Error #2048 url: 'http://localhost/my_php/public/gateway.php'
发布版本在我的本地主机上运行良好。我所有的php服务调用都在我的远程主机上。以下是我的远程主机的结构:

/my_directory/html (this is the root directory)
/my_directory/html/my_php/public/release  (this is where my .html wrapper and .swf files sit)
/my_directory/html/my_php/public (this is where my gateway.php and amf_config.ini files sit)
该错误特别引用了“localhost”,但我找不到设置该错误的位置。当我在google上搜索错误#2048时,解决方案指向一个配置不正确的跨域文件…我所有的服务都在remotehost(应用程序所在的位置)上,所以我认为这可能不是问题所在

这是我的amf_config.ini文件:

[zend]
webroot = "/my_directory/html"

zend_path ="/my_directory/html/ZendFramework/library"
library ="/my_directory/html/my_php/library"
services ="/my_directory/html/my_php/services"

[zendamf]
amf.production = false
amf.directories[]=/my_directory/html/my_php/services
这是我的gateway.php文件:

<?php
ini_set("display_errors", 1);
$dir = dirname(__FILE__);
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "$dir/amf_config.ini";
$servicesdir = $dir.'/../services';
$librarydir = $dir.'/../library';
//default zend install directory
$zenddir = $webroot.'/ZendFramework/library';
//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'];
}
if (isset($arr['zend']['library'])) {
    $librarydir = $arr['zend']['library'];
}
if (isset($arr['zend']['services'])) {
    $servicesdir = $arr['zend']['services'];
}
}
// Setup include path
// add zend directory, library and services to include path
set_include_path(get_include_path()
.PATH_SEPARATOR.$zenddir
.PATH_SEPARATOR.$librarydir
.PATH_SEPARATOR.$servicesdir);
// Initialize Zend Framework loader
require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance()->setFallbackAutoloader(true)->suppressNotFoundWarnings(true);
// 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) {
    if ($dir == "./") {
        $server->addDirectory($webroot);
    } else 
        if (realpath("{$webroot}/{$dir}")) {
            $server->addDirectory("{$webroot}/{$dir}");
        } else 
            if (realpath($dir)) {
                $server->addDirectory(realpath($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();

我在flex-blaze环境中也遇到了同样的问题。真正的问题是项目属性中的上下文根。
因为您使用了flex 4.5,所以此设置没有输入字段。在FlexBuilder3中,项目属性->flex服务器->上下文根目录中有一个设置

我发疯了,几个小时后在adobes bugs网站[FB-22939]上发现了一篇文章

这解决了我的问题。我不知道,在您使用的项目设置中,请尝试在项目中搜索名为{context.root}的字符串,或发布有关项目设置的详细信息。我知道blaze不同于php,但也许这是一个让您回到正轨的提示

不幸的是,我无法复制我的线程并设置一个php环境,更了解您的设置。(服务器技术,等等)

编辑: 其他信息: 我找到了所有编译器参数的列表。用这个参数试试看:

-context-root <context-path>
    full name -compiler.context-root
    path to replace {context.root} tokens for service channel endpoints
-上下文根目录
全名-compiler.context-root
替换服务通道终结点的{context.root}标记的路径

Frank

奇怪的是,错误消息引用了“”,但在我的网关或amf配置文件中没有引用“localhost”,您如何在Flex应用程序中调用此服务?远程对象的
端点
目标
属性是什么?如果在浏览器中打开gateway.php,会发生什么情况?根据错误消息,问题似乎是Flex调用Localhost..是的,gateway.php在我尝试直接在浏览器中加载时没有返回错误。我似乎找不到在php或应用程序中指定“localhost”的位置