3 Replies Latest reply on Nov 28, 2010 9:42 PM by dmera

    Flex/Zend channel connect failed error...

    jerry98225 Level 1

      Hi guys.

          I am using Flex and php to develop my project. Everything works great in my local machine. However, when I upload my files to my server (godaddy.com). I got the error when loading my flex application.


      The pop-up error message is


      send failed


      Netconnection.call.Badversion: url:



      I have upload my ZendFramewrok folder into my server and amf_config.ini has been configured. (webroot =http://mydomain)

      I am not sure what's going on here. Please help. Thanks.





      Update: my gateway.php

      ("display_errors", 1);
      = dirname(__FILE__);
      = "$dir/amf_config.ini";

      //default zend install directory
      = $webroot. '/ZendFramework/library'; //I did upload the ZendFramwork folder

      //Load ini file and locate zend directory
      if(file_exists($configfile)) {
      = $arr['zend']['webroot'];
      = $webroot. '/ZendFramework/library';
      = $arr['zend']['zend_path'];

      // Setup include path
      //add zend directory to include path
      // Initialize Zend Framework loader
      // Load configuration
      = new Zend_Config(array("production" => false), true);
      ->merge(new Zend_Config_Ini($configfile, 'zendamf'));
      = $default_config->amf;

      // Store configuration in the registry
      Zend_Registry::set("amf-config", $amf);
      // Initialize AMF Server
      = new Zend_Amf_Server();
      if(isset($amf->directories)) {
      = $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
      = strlen($dir);
      = $dir;
      if($length >= 1)
      = $dir[0];

      if($firstChar != "/"){
      // if the directory is ./ path then we add the webroot only.
      if($dir == "./"){      
      = $webroot . "/" . $dir;
      // Initialize introspector for non-production
      if(!$amf->production) {
      ->setClass('Zend_Amf_Adobe_Introspector', '', array("config" => $default_config, "server" => $server));
      ->setClass('Zend_Amf_Adobe_DbInspector', '', array("config" => $default_config, "server" => $server));
      // Handle request
      echo $server


      Error from gateway.php if I call it directly.



      Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in /home/content/79/4687979/html/parkerList/gateway.php on line 27


      Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='.:/usr/local/php5/lib/php:http://blackwheels.info//ZendFramework/library') in /home/content/79/4687979/html/parkerList/gateway.php on line 27


      gateway.php is the rat. but I still can't figure out what's wrong. Zend/Loader/Autoloader.php is under the server root "ZendFramework/library" folder. I don't understand why my application can't find it. Thanks again!

        • 1. Re: Flex/Zend channel connect failed error...



          I had the same problem (I think). I've got a kind of solution : not a very good one, but at least it works (for me)...


          So, I put the ZendFramework directory into my application directory (that's why it's not a good solution...), and changed the directories configuration in amf_config.ini and gateway.php.

          (on my server : ......./myFlexApp/ZendFramework)


          new  amf_config.ini file :

          ;set the absolute location path of webroot directory, example:
          ;Windows: C:\apache\www
          ;MAC/UNIX: /user/apache/www
          webroot = .

          ;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 = ./ZendFramework/library

          amf.production = true
          amf.directories[]= ./services



          and the beginning of the gateway.php file :

          ini_set("display_errors", 1);
          $dir = '.';
          $webroot = $_SERVER['DOCUMENT_ROOT'];
          $configfile = "amf_config.ini";

          //default zend install directory
          $zenddir = $webroot. '/ZendFramework/library';



          And for me that's OK.

          I'll try to fix the problem in a cleaner way later, with a ZendFramework directory separated from the application directory. Or maybe someone else can help ?... With a few "echoes" in the gateway.php file I wasn't able to understand what was wrong, I'm not familiar enough with php configuration.


          Hope this can help you !

          • 2. Re: Flex/Zend channel connect failed error...
            jerry98225 Level 1

            Thank you for the help oesiri.

            • 3. Re: Flex/Zend channel connect failed error...

              HI , I was reading ur problem and the answer given, and im trying to do the same in my hosting services but i cant seem to get it working have any of you gotten a better solution???