1

Flexとphpを使用してプロジェクトを開発しています。私のローカルマシンではすべてがうまく機能します。ただし、ファイルをサーバー(godaddy.com)にアップロードすると。flexアプリケーションをロードするときにエラーが発生しました。

ポップアップエラーメッセージは

失敗したchannel.connect.failed.errorを送信しますNetconnection.call.Badversion:url: http://mydomail/folder/gateway.php

ZendFramewrokフォルダーをサーバーにアップロードし、amf_config.iniを構成しました。(webroot = http:// mydomain)ここで何が起こっているのかわかりません。助けてください。ありがとう。

更新:私の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();

直接呼び出すとgateway.phpからエラーが発生します。

警告:require_once(Zend / Loader / Autoloader.php)[function.require-once]:ストリームを開くことができませんでした:27行目の/home/content/79/4687979/html/parkerList/gateway.phpにそのようなファイルまたはディレクトリはありません

致命的なエラー:require_once()[function.require]:必要な'Zend / Loader / Autoloader.php'(include_path ='。:/ usr / local / php5 / lib / php: http: //blackwheels.info// 27行目の/home/content/79/4687979/html/parkerList/gateway.phpのZendFramework/library ')

ペッカ。あなたが正しいです。Gateway.phpはネズミです。しかし、私はまだ何が悪いのか理解できません。Zend / Loader / Autoloader.phpは、サーバールートの「ZendFramework/library」フォルダーの下にあります。アプリケーションがそれを見つけられない理由がわかりません。再度、感謝します!

4

4 に答える 4

1

include_dirが正しく設定されていないようです。Autoloader.phpあなたはそれがにあると言いますZendFramework/library。それを見つけるには、そのディレクトリでインクルードファイルを探すようにPHPを設定する必要があります。

これはset_include_pathで設定できます

于 2010-11-02T18:03:00.390 に答える
1

私は同じ問題を抱えていたので、コマンド「require」または「require_once」のパスを修正して解決しました。

Windows localhost では正常に動作していましたが、Linux サーバーにアップロードした後、先頭のスラッシュが原因ですべての必要なパスを更新する必要がありました。Linuxはそれを別の方法で理解します;)

pukka へのコメントに基づいて、27 行目を次のように変更することで問題を解決できます。

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

これが私たちと同じ状況にある誰かに役立つことを願っています.

ところで、同名のとおりです。これらのツールは本当に素晴らしいです。私は別のものを使用しています (Charles または Wireshark - これは少し重いです) が、それらがなければ進歩はありません ;)

于 2012-04-17T15:27:54.910 に答える
1

私の賭けは、それがgateway.phpエラーをスローしていて、Flex アプリが期待する結果を混乱させているということです。gateway.php直接電話してみては?

于 2010-07-06T20:43:37.520 に答える
0

これは、ServiceCaptureが便利な場所です-Flex/ PHPとのやり取りが表示され、クラッシュした場合は、通常のPHPトレースも表示されます

http://www.kevinlangdon.com/serviceCapture/

于 2010-11-02T17:59:01.687 に答える