Skip navigation
Currently Being Moderated

Flex + amf php server deployment problem

Dec 29, 2010 3:33 AM

Hi all,

 

After almost a month of research on this problem. I was able to remove all my errors on production but still not able to retrieve data.

Please help......

Here is the scenerio details :

I created a form which will take input from user and store those values in database.you can visit it here on web server :

http://www.accurateoptics.in/

I followed all the steps mentioned on adobe's test drive tutorial. It works fine on my local machine with WAMP installation. But the moment,

I upload it...Bang!!!! there comes the error ::::

Channel.Connect.Failed error NetConnection.Call.BadVersion: : url: http://www.accurateoptics.in/gateway.php

I googled again, read a lot of articles and figured out that some changes are required in my gateway.php and amf-config.ini files for production environment.

 

Did the necessary changes and uploaded again.Bang!!!!!!! new error comes:::::::

Channel disconnected before an acknowledgement was received.

 

to solve this, again googled a lot and figured out that i need to upload zend framework files so, did that and setting up the path for zend in amf-config.ini.

uploaded again.

 

Now, i am stuck at this point where no error is thrown only an alert box comes with a ok button. also, data is not retrieved from server.

error screenshot.png

 

I dont know what error i am making.here is my amf-config.ini file:::::::::::::

 

[zend]

;set the absolute location path of webroot directory, example:

;Windows: C:\apache\www

;MAC/UNIX: /user/apache/www

webroot =http://www.accurateoptics.in

 

;set the absolute location path of zend installation directory, example:

;Windows: C:\apache\PHPFrameworks\ZendFramework\library

;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library

;zend_path =

zend_path = ./ZendFramework/library

[zendamf]

amf.production = true

amf.directories[]= http://www.accurateoptics.in/services

 

here is my gatway.php file :::::::::::::;

 

<?php

ini_set("display_errors", 1);

//$dir = dirname(__FILE__);

$dir = '.';

$webroot = $_SERVER['DOCUMENT_ROOT'];

//$configfile = "$dir/amf_config.ini";

$configfile = "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'];

}

}

 

  

// Setup include path

//add zend directory to include path

set_include_path(get_include_path().PATH_SEPARATOR.$zenddir);

// Initialize Zend Framework loader

require_once 'Zend/Loader/Autoloader.php';

Zend_Loader_Autoloader::getInstance();

// 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) {

// get the first character of the path.

// If it does not start with slash then it implies that the path is relative to webroot. Else it will be treated as absolute path

$length = strlen($dir);

$firstChar = $dir;

if($length >= 1)

$firstChar = $dir[0];

 

if($firstChar != "/"){

// if the directory is ./ path then we add the webroot only.

if($dir == "./"){

$server->addDirectory($webroot);

}else{

$tempPath = $webroot . "/" . $dir;

$server->addDirectory($tempPath);

}

}else{

$server->addDirectory($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();

?>

 

 

Looking for some help!! Thanks in advance..............

 
Replies
  • Currently Being Moderated
    Dec 29, 2010 6:59 AM   in reply to Vaibhav Bhasin

    Have you tried visting the endpoint.php file in your browser (Firefox preferably). While also logging any errors (this could also include setting "display_errors","1") at the top of your endpoint.php file.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 7:53 AM   in reply to Vaibhav Bhasin

    I have the same EXACT problem and went through the same exact steps...  I am also using WAMPServer and deploying on linux.  Did this ever get resolved?

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 8:05 AM   in reply to TJHallow32

    In your amf-config.ini, I see you are using a URL instead of a directory path. I think you need to specify the file system path (mine does, and works just fine).

     

    Also, I would suggest setting production to false until you have the errors sorted out. Debugging is difficult in production mode.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 10:02 AM   in reply to drkstr_1

    Ok, I got it working.  The null error box is caused by setting production to true (as drkstr states).  

     

    "Channel disconnected before an acknowledgement was received" basically means that there was an error in thr PHP service.  Look in the apache error_log.  In my case it was the mysql user was set up differently than my WAMPserver.

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 28, 2011 7:59 PM   in reply to TJHallow32

    Heh. I didn't realize I was replying to a post from 2010. At least it was of some help to you.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points