Channel.Security.Error...错误 #2048 [英] Channel.Security.Error...Error #2048

查看:17
本文介绍了Channel.Security.Error...错误 #2048的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近升级到了用于 PHP 的 Flash Builder 4.5,并且正在尝试将发布版本上传到我的远程服务器.当我尝试从应用程序进行 php 调用时,出现错误:

I recently upgraded to Flash Builder 4.5 for PHP and am trying to upload a release build to my remoteserver. When I try to make a php call from the app, I get the error:

Send failednChannel.Security.Error error Error #2048 url: 'http://localhost/my_php/public/gateway.php'

发布版本在我的本地主机上运行良好.我所有的 php 服务调用都在我的远程主机上.这是我的远程主机的结构:

The release build works fine on my localhost machine. All of my php service calls are on my remote host. Here's the structure of my remote host:

/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",但我找不到设置的位置.当我用谷歌搜索错误 #2048 时,解决方案指向一个配置错误的跨域文件......我所有的服务都在远程主机上(托管应用程序的地方),所以我认为这不是问题.

The error specifically references 'localhost', but I can't find where that gets set. When I google error #2048, the solutions point to a badly configured crossdomain file...all my services are on remotehost (where the app is hosted) so I don't think that could be the issue.

这是我的 amf_config.ini 文件:

Here is my amf_config.ini file:

[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 文件:

Here is my gateway.php file:

<?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,所以此设置没有输入字段.在 flex builder 3 中,项目属性 -> flex server -> 上下文根中有一个设置.

i had the same problem in a flex - blaze - environment. The real Problem was the context-root in the project properties. because you used flex 4.5, there is no input field for this setting. in flex builder 3, there was a setting in the project properties -> flex server -> context root.

我发疯了,几小时后发现了一篇关于 adobes bugs-site [FB-22939] 的文章.

i gone crazy and found after hours an article on adobes bugs-site [FB-22939].

那解决了我的问题.我不知道您正在使用的项目设置,尝试在您的项目中搜索名为 {context.root} 的字符串或发布更多关于您的项目设置的信息.我知道 blaze 与 php 不同,但也许它是让您重回正轨的提示.

That solve my problem. I have no idea, wich project settings you are using, try to search a string named {context.root} in your project or post a liite bit more about your project settings. i know blaze is different from php, but maybe it is a tip bringing you back on track.

不幸的是,我无法重现我的线程并使用有关您的设置的更多知识来设置 php 环境.(服务器技术等)

Unfortunately I'm not able to reproduce my thread and setting up an php environment with more knowledge about your setup. (Server-Technology, and so one)

附加信息:我找到了所有编译器参数的列表.用这个参数试试:

edit: additional Info: I've found a list of all compiler arguments. Try it with this argument:

-context-root <context-path>
    full name -compiler.context-root
    path to replace {context.root} tokens for service channel endpoints

br弗兰克

这篇关于Channel.Security.Error...错误 #2048的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆