2010-07-06 92 views
1

我正在使用Flex和PHP來開發我的項目。一切工作在我的本地機器很好。但是,當我將我的文件上傳到我的服務器(godaddy.com)時。加載我的Flex應用程序時出現錯誤。Flex/Zend通道連接失敗錯誤

彈出錯誤信息是

發送失敗 channel.connect.failed.error Netconnection.call.Badversion:網址: http://mydomail/folder/gateway.php

我有我的上傳文件夾ZendFramewrok到我的服務器和amf_config.ini已配置。 (webroot = http://mydomain) 我不確定這裏發生了什麼。請幫忙。謝謝。

更新:從如果我直接調用它gateway.php 我gateway.php

<?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'; //I did upload the ZendFramwork folder 

//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(); 

錯誤。

警告:require_once(的Zend /裝載機/ Autoloader.php) [function.require一次]:未能打開流:在 /家庭/內容沒有這樣的文件或目錄/4687979分之79/ HTML/parkerList/gateway.php第27行

致命錯誤:require_once()[function.require]:無法開口需要 '的Zend /裝載機/ Autoloader.php' (include_path中=」:在/ usr /本地/ PHP5/lib中/ php:http://blackwheels.info//ZendFramework/library') in /home/content/79/4687979/html/parkerList/gateway.php on line 27

Pekka。你是對的。 gateway.php是老鼠。但我仍然無法弄清楚什麼是錯的。 Zend/Loader/Autoloader.php位於服務器根目錄「ZendFramework/library」文件夾下。我不明白爲什麼我的應用程序找不到它。再次感謝!

+0

請把你的'gateway.php '看看它是否會拋出任何錯誤。 – 2010-07-06 20:48:31

+0

另外,調用PHP腳本的部分Flex代碼將很好發佈。 – 2010-07-06 20:49:04

回答

1

設置此我有同樣的問題,我在指令修正路徑解決它「需要」或「require_once」。

在Windows本地主機上運行正常,但在上傳到我的linux服務器後,由於引導斜槓導致所有需要的路徑都需要更新。Linux的理解不同的看法;)

基於對PUKKA您的意見,您的問題將通過改變線路27來解決,以

require_once $zenddir. '/Zend/Loader/Autoloader.php'; 

希望這有助於有人在同樣的情況就像我們。

BTW dittonamed是正確的,這些工具真的很棒,我只是用不同的(查爾斯或Wireshark的 - 這是一個有點重),但不會有沒有他們,沒有任何進展;)

1

我敢打賭,它的gateway.php是拋出一個錯誤,並歪曲你的Flex應用程序預期的結果。你能直接撥打gateway.php嗎?

+1

謝謝佩卡。我無法直接調用gateway.php。它通過Flex應用程序。我只是把我的gateway.php代碼放在這裏。謝謝回覆。 +1 – FlyingCat 2010-07-06 20:48:21

+0

@Jerry難道你不能直接調用它,只是爲了看看它是否有效,沒有任何明顯的致命錯誤等? – 2010-07-06 20:49:52

1

它看起來像您的include_dir設置不正確。你說Autoloader.phpZendFramework/library。爲了找到這個,你需要設置PHP來查找包含文件的目錄。

您可以set_include_path

+0

你是一個拯救生命的人! – 2011-04-01 11:59:35