मैं हाल ही में PHP के लिए फ्लैश बिल्डर 4.5 करने के लिए उन्नत और एक रिलीज मेरी RemoteServer के निर्माण को अपलोड करने की कोशिश कर रहा हूँ। जब मैं app से एक php कॉल करने के लिए प्रयास करते हैं, मैं त्रुटि मिलती है:Channel.Security.Error ... त्रुटि # 2048
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)
त्रुटि विशेष रूप से संदर्भ 'स्थानीय होस्ट', लेकिन मैं जहां कि सेट हो जाता है नहीं मिल रहा। जब मैं त्रुटि # 2048 गूगल, समाधान एक बुरी तरह से कॉन्फ़िगर किया गया crossdomain फ़ाइल को इंगित ... मेरी सभी सेवाएँ remotehost (जहां एप्लिकेशन होस्ट किया गया है) पर हैं तो मुझे नहीं लगता कि इस मुद्दे हो सकता है। - आग - पर्यावरण
<?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();
अजीब तरह से, त्रुटि संदेश के संदर्भ में "http: //localhost/my_php/public/gateway.php" लेकिन वहाँ कोई संदर्भ नहीं है करने के लिए "स्थानीय होस्ट" में मेरा गेटवे या एएमएफ कॉन्फ़िगरेशन फ़ाइल –
आप इस सेवा को अपने फ्लेक्स ऐप में कैसे कॉल कर रहे हैं? आपके रिमोट ऑब्जेक्ट के 'एंडपॉइंट', 'स्रोत', 'गंतव्य' गुण क्या हैं? अगर आप अपने ब्राउज़र में गेटवे.एफ़पी खोलते हैं तो क्या होता है? त्रुटि संदेश के अनुसार, ऐसा लगता है, कि समस्या है, कि फ्लेक्स कॉल स्थानीय होस्ट .. – sydd
हाँ, gateway.php कोई त्रुटि देता है जब मैं ब्राउज़र में इसे सीधे लोड करने के लिए प्रयास करें। मुझे लगता है कि php या ऐप में 'localhost' निर्दिष्ट नहीं किया जा रहा है –