canal Flex / Zend error de conexión fallido
-
02-10-2019 - |
Pregunta
Estoy usando Flex y PHP para desarrollar mi proyecto. Todo funciona muy bien en mi máquina local. Sin embargo, cuando subo mis archivos a mi servidor (godaddy.com). Tengo el error al cargar mi aplicación Flex.
El mensaje de error emergente es
Enviar falló channel.connect.failed.error Netconnection.call.Badversion: url: http: //mydomail/folder/gateway.php
Tengo subir mi carpeta ZendFramewrok en mi servidor y amf_config.ini se ha configurado. (Webroot = http: // mydomain ) No estoy seguro de lo que está pasando aquí. Por favor ayuda. Gracias.
Actualización: mi 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();
Error de gateway.php si llamo directamente.
Advertencia: require_once (Zend / cargadora / Autoloader.php) [Function.require una vez]: no pudo flujo abierto: No existe el fichero o directorio en /home/content/79/4687979/html/parkerList/gateway.php en la línea 27
Fatal error: require_once () [function.require]: apertura Error requiere 'Zend / cargador / Autoloader.php' (Include_path =':. / Usr / local / php5 / lib / php: http://blackwheels.info/ / ZendFramework / biblioteca ') en /home/content/79/4687979/html/parkerList/gateway.php en la línea 27
Pekka. tienes razón. gateway.php es la rata. pero todavía no puedo averiguar lo que está mal. Zend / cargador / Autoloader.php está en la raíz del servidor "ZendFramework / biblioteca" carpeta. No entiendo por qué mi aplicación no puede encontrarlo. Gracias de nuevo!
Solución
Yo tenía el mismo problema y lo resolví mediante la corrección de caminos en el comando 'requieren' o 'require_once'.
Se ejecuta bien cuando en Windows localhost, pero después de subir a mi servidor Linux, todos mis caminos necesarios requieren actualización, a causa de barras al principio. Linux entiende de manera diferente;)
Basado en su comentario a pukka, su problema podría resolverse cambiando la línea 27 a
require_once $zenddir. '/Zend/Loader/Autoloader.php';
Espero que esto ayude a alguien en la misma situación como estábamos.
Por cierto dittonamed tiene razón, estas herramientas son realmente grande, sólo tiene que utilizar diferentes (Charles o Wireshark - que es un poco pesado), pero no habría ningún progreso sin ellos;)
Otros consejos
Mi apuesta es que es gateway.php
que está lanzando un error, y el resultado garbling sus Espera de aplicaciones Flex. Se puede tratar de llamar directamente gateway.php
?
Parece que tu include_dir está mal ajustado. Usted dice que está en Autoloader.php
ZendFramework/library
. Por la que se encuentra, es necesario configurar PHP para mirada de ese directorio para incluir archivos.
Se puede configurar esto con set_include_path
Aquí es donde Captura servicio es muy útil - que le mostrará la comunicación de ida y vuelta con Flex / PHP y si su estrellarse - también le mostrará la traza normal de PHP