I'm developing a web application with Flex and PHP using the ZendAMF protocol. Since yesterday I have this strange problem occurring whenever I'm publishing the application to the remote server. Locally everything works fine it's only when I publish it on the server. Here is the ErrorMessage I get:
Send failed
Channel.Security.Error error Error #2048: Security sandbox violation: http://mydomain.com/login/MainFrame.swf cannot load data from http://localhost/bin-debug/gateway.php. url: 'http://localhost/bin-debug/gateway.php'
I'm pretty sure there is nothing wrong with my gateway.php and amf_config file since I know that they are slightly different. (I'm using these files from a backup place where things did work)
Further on I copied my crossdomain.xml also on the web root and on the application dir where it automatically get into. This is the content:
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
The problem is that in production release it's still trying to access the local files. I've tried searching a lot about this problem but didn't found the same as my case.
gateway.php source part
<?php
ini_set("display_errors", 1);
$dir = dirname(__FILE__);
$webroot = $_SERVER['DOCUMENT_ROOT'];
$configfile = "$dir/amf_config.ini";
//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'];
}
}
What can I try next to solve this problem?
http://mydomain.com/
requires information fromhttp://localhost/
in this case your
http://localhost/crossdomain.xml
should allow requests fromhttp://mydomain.com/
just make sure your crossdomain.xml is ok