2010-07-06 2 views
1

Flex 및 PHP를 사용하여 프로젝트를 개발 중입니다. 모든 것이 내 로컬 컴퓨터에서 잘 작동합니다. 그러나 내 서버 (godaddy.com)에 파일을 업로드 할 때. Flex 애플리케이션을로드 할 때 오류가 발생했습니다. URL : http://mydomail/folder/gateway.phpFlex/Zend 채널 연결 실패 오류

내 서버에 내 ZendFramewrok 폴더를 업로드해야하고

팝업 오류 메시지가 전송이 channel.connect.failed.error에게 Netconnection.call.Badversion 실패

입니다 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를 (젠드/로더/Autoloader.php) [function.require-번] : 스트림을 열지 못했습니다 :/ /홈/내용에 해당 파일이나 디렉토리를 4,687,979분의 79/HTML/parkerList/gateway.php 라인 27

치명적인 오류 : require_once를가() function.require] 실패 개구 '젠드/로더/Autoloader.php' (include_path를 필요 = './usr/지방/PHP5/LIB/php : http://blackwheels.info//ZendFramework/library ') /home/content/79/4687979/html/parkerList/gateway.php 온라인 27

Pekka. 당신 말이 맞아요. gateway.php는 쥐입니다. 그러나 나는 아직도 무엇이 잘못되었는지 알 수 없다. Zend/Loader/Autoloader.php는 서버 루트 "ZendFramework/library"폴더 아래에 있습니다. 내 응용 프로그램에서 찾을 수없는 이유를 이해할 수 없습니다. 다시 한 번 감사드립니다!

+0

당신의'gateway.php 문의하시기 바랍니다)하지만 그들 없이는 진전이 없을 것 - BTW dittonamed

는 이러한 도구, 난 그냥 다른 (조금 무겁 찰스 또는 Wireshark를) 정말 잘 사용하는 권리 '오류를 던지는지 확인하십시오. –

+0

또한 PHP 스크립트를 호출하는 Flex 코드 일부를 게시하는 것이 좋습니다. –

답변

1

이것을 설정할 수 있습니다 저도 같은 문제가 있었 내가 명령 경로를 수정하여 그것을 해결 '필요'또는 'require_once를'.

Windows localhost에서는 괜찮 았지만 Linux 서버에 업로드 한 후에는 슬래시가 있기 때문에 필요한 모든 경로를 업데이트해야했습니다.무게가 충분한에 대한 귀하의 의견을 바탕으로

가 문제가 우리가 있었던 것처럼이 같은 상황에서 누군가에게 도움이

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

호프 라인 (27)을 변경하여 해결 될 것이다) 리눅스는 다르게 이해한다.

1

내 생각에 오류가 발생하여 Flex 응용 프로그램에서 예상하는 결과가 왜곡됩니다. gateway.php입니다. gateway.php에 직접 전화 해 볼 수 있습니까? 서비스 캡처 편리한 곳에

+1

Pekka 감사합니다. gateway.php를 직접 호출 할 수 없습니다. 그것의 플렉스 애플리케이션을 통해. 나는 여기에 내 gateway.php 코드를 넣는다. 답장을 보내 주셔서 감사합니다. +1 – FlyingCat

+0

@Jerry 명백한 치명적인 오류가 없는지 여부를 확인하기 위해 직접 호출 할 수는 없습니까? –

1

그것은처럼 보이는 정상 PHP 추적을 표시합니다 include_dir이 잘못 설정되었습니다. Autoloader.phpZendFramework/library입니다. 이를 찾으려면 PHP가 해당 디렉토리에서 포함 파일을 찾도록 설정해야합니다.

당신은 set_include_path

+0

당신은 생명의 은인입니다! –