flex – Channel.Security.Error …错误#2048
发布时间:2020-12-15 01:49:14 所属栏目:百科 来源:网络整理
导读:我最近升级到Flash Builder 4.5 for PHP,并尝试将发布版本上传到我的remoteserver.当我尝试从应用程序进行php调用时,我收到错误: Send failednChannel.Security.Error error Error #2048 url: 'http://localhost/my_php/public/gateway.php' 发布版本在我的
我最近升级到Flash Builder 4.5 for
PHP,并尝试将发布版本上传到我的remoteserver.当我尝试从应用程序进行php调用时,我收到错误:
Send failednChannel.Security.Error error Error #2048 url: 'http://localhost/my_php/public/gateway.php' 发布版本在我的localhost机器上运行正常.我的所有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时,解决方案指向一个配置错误的跨域文件…我的所有服务都在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',"server" => $server)); } // Handle request echo $server->handle(); 解决方法
我在flex-blaze环境中遇到了同样的问题.真正的问题是项目属性中的上下文根.
因为您使用了flex 4.5,所以此设置没有输入字段.在flex builder 3中,项目属性中有一个设置 – > flex服务器 – >上下文根. 我疯了,发现了一篇关于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 endpoints BR坦率 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- Flex AdvancedDataGrid动态添加列并绑定数据库返回数据
- 实习日志(8):Flex的TitleWindow控件
- objective-c – 在接口构建器中将列添加到nstableview
- bonecp所依赖jar包
- react-native – 如何正确地将导航重置为另一个视图
- ruby-on-rails – RSpec未定义方法’应该’
- Xml序列化当泛型不同时序列化(反序列化)为不同的Xml节点名
- [Swift]LeetCode343. 整数拆分 |
- Flex Application 初始化事件的顺序
- ruby-on-rails – warden.authenticate之间有什么区别?和u