Visualizzazione dei risultati da 1 a 7 su 7
  1. #1
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289

    problemi con il file gateway.php di amfphp

    ciao a tutti..uso easyphp 1.8..ho installato i component di flash8 per il remoting ho installato correttamente amfphp seguendo la guida all' installazione a questo indirizzo:

    http://www.sephiroth.it/tutorials/fl..._installation/

    nella cartella amfphp c'è una cartella services e mi viene detto di portarla nella cartella della root del mio easyphp1.8..la cartella in questione si chiama www..lo faccio poi mi viene detto di copiare il file gateway.php che è nella cartella amfphp, nella cartella services che ho spostato prima nella cartella www di easyphp1.8(root)

    fino a qui tutto bene..

    mi si chiede di lanciare in locale sul browser il seguente indirizzo:

    http://localhost/services/gateway.php

    ed è a questo punto che il browser mi da una pag bianca con questo errore:

    Parse error: parse error in d:\programmi\easyphp1-8\www\services\gateway.php on line 3

    ora mi e vi chiedo...dovè l'errore?

    qualcuno ha il file gateway.php esatto per come deve essere per far funzionare il tutto..
    oppure cosa devo cambiare nel mio?

    questo il codice del file gateway.php:

    <?php

    $Id: gateway.php,v 1.4 2005/07/05 07:40:54 pmineault Exp $

    The gateway is a customized entry point to your flash
    services.

    Things you can set here:

    - setBaseClassPath(string path) The absolute path to your services on the server

    - setLooseMode(bool mode) If true, output buffering is enabled and error_reporting
    is lowered to circumvent a number of documented NetConnection.BadVersion errors

    - setCharsetHandler(string mode, string phpCharset, string sqlCharset)

    mode can be one of
    - none don't do anything
    - iconv uses the iconv libray for reencoding
    - mbstring uses the mbstring library for reencoding
    - recode uses the recode library for reencoding
    - utf8_decode uses the XML function utf8_decode and encode for
    reencoding - ISO-8859-1 only

    phpCharset is the charset that the system assumes the PHP strings will be in.

    sqlCharset is the charset of sql result sets used (only when outputting results
    to flash client)

    wsCharset (web service charset) has been eliminated from this release, UTF-8
    is assumed as the remote encoding. When using PHP5 SoapClient, the SoapClient
    object will be initialized with "encoding" => phpCharset. When using nusoap,
    soapclient->soap_defencoding will be initialized with phpCharset.

    The following settings are recommended (try the first setting appropriate for
    your language, if it doesn't work try the second):

    * English:

    $gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );

    * Western european languages (French, Spanish, German, etc.):

    $gateway->setCharsetHandler( "iconv", "ISO-8859-1", "ISO-8859-1" );
    $gateway->setCharsetHandler( "utf8_decode", "ISO-8859-1", "ISO-8859-1" );

    * Eastern european languages (Russian and other slavic languages):

    $gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
    $gateway->setCharsetHandler( "iconv", "your codepage", "your codepage" );

    * Oriental languages (Chinese, japanese, korean):

    $gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );
    $gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );

    * Other languages:

    $gateway->setCharsetHandler( "iconv", "UTF-8", "UTF-8" );
    $gateway->setCharsetHandler( "none", "ISO-8859-1", "ISO-8859-1" );

    iconv is included by default in php5, but not in php4 although most
    hosts have it installed. utf8_decode is of some use for Western European languages,
    but please remember that it won't work with settings other than ISO-8859-1.
    The other methods also require seldom-used extensions but were included
    just in case your particular host only supports them.

    - setWebServiceHandler(string handler)
    Handler can be one of:
    - php5 (that is, PHP5 SoapClient)
    - pear
    - nusoap
    This is used for webservices when working with http:// service names in
    new Service(). For php5 and pear, you will need to have it installed on your
    server. For nusoap, you need nusoap.php instead in ./lib relative to this file.

    If you have PHP5 and the SOAP extension installed it is highly recommended that
    you use it as it is _much_ faster than NuSOAP or PEAR::SOAP

    Things you may want to disable for production environments:

    - disableStandalonePlayer()
    Disables the standalone player by filtering out its User-Agent string

    - disableServiceDescription()
    Disable service description from Macromedia's service browser

    - disableTrace()
    Disables remote tracing

    - disableDebug()
    Stops debug info from being sent (independant of remote trace setting)


    include "app/Gateway.php";

    //You can set this constant appropriately to disable traces and debugging headers
    //You will also have the constant available in your classes, for changing
    //the mysql server info for example
    define("PRODUCTION_SERVER", false);

    $gateway = new Gateway();

    //Set where the services classes are loaded from, *with trailing slash*
    $gateway->setBaseClassPath("services/");

    //Loose mode means echo'ing or whitespace in your file won't make AMFPHP choke
    $gateway->setLooseMode(true);

    //Read above large note for explanation of charset handling
    //The main contributor (Patrick Mineault) is French,
    //so don't be afraid if he forgot to turn off iconv by default!
    //$gateway->setCharsetHandler("utf8_decode", "ISO-8859-1", "ISO-8859-1");

    //Error error types that will be rooted to the NetConnection debugger
    $gateway->setErrorHandling(E_ALL ^ E_NOTICE);

    //choices are php5 (SoapClient), nusoap and pear
    //If you don't plan on using web services with AMFPHP,
    //you can safely let this setting alone
    $gateway->setWebServiceHandler('php5');

    //Adding an adapter mapping will make returns of the mapped typed be intercepted
    //and mapped in adapters/%adapterName%Adapter.php. This works by using get_class
    //So for example, if you return a PEAR resultset object, it is an instance of DB_result
    //And we want this to be processed as a recordset in adapters/peardbAdapter.php,
    //hence the following line:
    $gateway->addAdapterMapping('db_result', 'peardb');
    //For PDO (PHP 5.1 specific)
    $gateway->addAdapterMapping('pdostatement', 'pdo');
    //For oo-style MySQLi
    $gateway->addAdapterMapping('mysqli_result', 'mysqli');
    //For filtered array
    //And for filtered typed array (see adapters/lib/Arrayf.php and Arrayft.php)
    $gateway->addAdapterMapping('arrayf', 'arrayf');
    $gateway->addAdapterMapping('arrayft', 'arrayft');
    //And you can add your own after this point... (note lowercase for both args!)

    if(PRODUCTION_SERVER)
    {
    //Disable trace actions
    $gateway->disableTrace();

    //Disable debugging headers
    $gateway->disableDebug();

    //Disable Service description
    $gateway->disableServiceDescription();
    }

    //If you are running into low-level issues with corrupt messages and
    //the like, you can add $gateway->logIncomingMessages('path/to/incoming/messages/');
    //and $gateway->logOutgoingMessages('path/to/outgoing/messages/'); here

    //If using under SSL (https) with IE6, usually the default amfphp method will
    //work. It is however possible that it doesn't, in which case, enable the
    //second SSL method, and apply the patch described here:
    //http://www.gmrweb.net/2005/08/18/flash-remoting-https-internet-explorer/
    //(requires mod_headers)
    //$gateway->useSslSecondMethod();

    //Service now
    $gateway->service();

    ?>


    spero di essere stato chiaro...grazie a tutti ciao




    qiundi sposto la cartella services nella cartella www
    disciple of dice.....

  2. #2
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    ma non c'è un commento davanti al testo che spiega il funzionamento del file?

    Tipo cosi:
    codice:
    /*
    The gateway is a customized entry point to your flash
    services.

  3. #3
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    si..io l'ho tolto..perchè con il commento mi dava questi errori:

    Warning: main(app/Gateway.php): failed to open stream: No such file or directory in d:\programmi\easyphp1-8\www\services\gateway.php on line 96

    Warning: main(): Failed opening 'app/Gateway.php' for inclusion (include_path='.;D:/Programmi/EasyPHP1-8\php\pear\') in d:\programmi\easyphp1-8\www\services\gateway.php on line 96

    Fatal error: Cannot instantiate non-existent class: gateway in d:\programmi\easyphp1-8\www\services\gateway.php on line 103

    mentre togliendo il commento solo questo:

    Parse error: parse error in d:\programmi\easyphp1-8\www\services\gateway.php on line 3


    poi magari dovevo lasciare il commento ma visto che avevo 2 errori in meno l'ho tolto..e cmq anche con i commenti non riesco a capire cosa devo cambiare..

    ma per caso tu hai questo file funzionante?
    disciple of dice.....

  4. #4
    Utente di HTML.it L'avatar di gianiaz
    Registrato dal
    May 2001
    Messaggi
    8,027
    scusa, ma la tua logica è abbastanza sindacabile.

    Hai 2 errori in meno perchè si ferma prima, il file è corretto, probabilmente i problemi che hai sono dovuti a percorsi errati...

    Rimetti il commento, e cerca di interpretare gli errori, posizionando nella dir corretta il file richiesto.

    In pratica il file gateway.php cerca di includere nella sottodirectory app il file Gateway.php (con la G maiuscola).

    Ciao

  5. #5
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    ok..scusami l'estrema ignoranza .. :berto:
    quindi a quanto ho capito devo cambiare i percorsi della riga 96 e 106!

    quindi questa:96

    include "app/Gateway.php";

    e questa:106

    $gateway->setBaseClassPath("services/");

    il mio file gateway.php scritto con la g minuscola è nella cartella services che a sua volta è sotto la cartella www

    quali sono i percorsi giusti che devo dare?devo creare una cartella app e mettergli il file gateway con la g maiusc....illuminami ti prego...grazietante...ciaociao

    se funziona cosa mi dovrebbe succedere?
    disciple of dice.....

  6. #6
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    mi spiace ma continuo a far tentativi ma niente..
    dove erro?
    ho messo la cartella amfphp che contiene pure la cartella services nella cartella www(root)..
    ora cosa devo cambiare del file gateway per farlo funzionare?
    ma devo andare anche nel pannello browser service di flash e far qualcosa?
    io ho easyphp 1.8 dove gira il php 4..è possibile che il mio amfphp1.01 nn giri perchè richiede il php 5...
    aiuto sto impazzendo..
    gli errori sono semptre gli stessi..scusate sarò cerebroleso ma nn riesco a farlo funzionare...aiutatemi voi guru....
    grazie ciaociao..
    disciple of dice.....

  7. #7
    Utente di HTML.it L'avatar di laghe
    Registrato dal
    Nov 2004
    Messaggi
    289
    yesssss.....i got it...
    allora ho scaricato l'ultima versione di amfphp (1.25)
    ho seguito il tutorial per l'installazione qui:

    http://www.actionscript.org/resource...ing/Page1.html

    e tutto funziona..o meglio per ora mi riconosce amfphp.. infatti se vado sul browser e digito:

    http://localhost/amfphp/gateway.php

    mi esce una pagina bianca con scritto:

    amfphp and this gateway are installed correctly. You may now connect to this gateway from Flash.

    Note: If you're reading an old tutorial, it will tell you that you should see a download window instead of this message. This confused people so this is the new behaviour starting from amfphp 1.2.

    per ora sono contento.. tra un pò sicurammente non lo sarò più.. perchè incontrerò mille ostacoli..
    meno male però che cè gente come voi del forum...grazie a tutti..ciao
    disciple of dice.....

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.