我最近升级到PHP的Flash Builder4.5for PHP,并且正在尝试上传一个发布版本到我的远程服务器。当我试图从应用程序中调用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',但是我找不到设置它的位置。当我谷歌错误#2048,解决方案指向一个配置错误的跨域file...all我的服务在远程主机(应用程序托管的地方),所以我不认为这可能是问题所在。
这是我的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();发布于 2011-11-05 21:15:46
我在flex - blaze环境中也遇到了同样的问题。真正的问题是项目属性中的上下文根。因为您使用的是flex4.5,所以此设置没有输入字段。在flex builder3中,在项目属性-> flex server ->上下文根中有一个设置。
我发疯了,下班后发现了一篇关于adobes bugs-site 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 endpointsbr Frank
https://stackoverflow.com/questions/7974783
复制相似问题