Visualizzazione risultati 1 fino 16 di 16

Discussione: PHP Symfony deploy

  1. #1
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito PHP Symfony deploy

    Ciao,
    Ho una web server implementato con il framework Symfony, mi sapete dire come posso farla eseguire sul mio spazio altervista?


    Grazie

  2. #2
    mzanella non è connesso AlterGuru
    Data registrazione
    29-12-2015
    Messaggi
    1,954

    Predefinito

    Non credo sia possibile: Symfony non fa parte degli strumenti messi a disposizione da AlterVista, e non è possibile installarlo in quanto richiede phar e/o composer (ed altri motivi: Installing and Configuring Symfony).

    Meglio aspettare una risposta certa da parte dello staff.

  3. #3
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    L'estensione Phar è attiva ma non è disponibile l'esecuzione da interfaccia testuale (riga di comando), quindi temo non sia possibile usare gli strumenti ufficiali per installare i vari componenti.
    Con il codice dei vari componenti comunque non dovrebbero esserci problemi, quindi potresti provare ad installarli un altro server e poi caricare i file PHP su AlterVista.

  4. #4
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    Ho provato ma non va! Altre soluzioni?

  5. #5
    L'avatar di dreadnaut
    dreadnaut non è connesso Super Moderatore
    Data registrazione
    22-02-2004
    Messaggi
    6,266

    Predefinito

    Citazione Originalmente inviato da franco7scala Visualizza messaggio
    Ho provato ma non va! Altre soluzioni?
    Cosa hai provato? Cosa non va? È difficile esserti di aiuto se non sei più preciso.

  6. #6
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    Questo è l'errore che mi da:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator, info@altervista.org and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.

    Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
    Ultima modifica di karl94 : 08-05-2016 alle ore 23.25.17 Motivo: Formattazione

  7. #7
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Compare immediatamente o dopo svariati secondi? Puoi indicare l'indirizzo della pagina in questione?

  8. #8
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    immediatamente

    questo è il link:
    http://letsolveit.altervista.org/web/lucky/number2

  9. #9
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Sembra essere un problema legato al file .htaccess presente nella radice dello spazio web, puoi riportarne qua il suo contenuto?

  10. #10
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    ecco il contenuto:

    Codice:
    # Use the front controller as index file. It serves as a fallback solution when
    # every other rewrite/redirect fails (e.g. in an aliased environment without
    # mod_rewrite). Additionally, this reduces the matching process for the
    # start page (path "/") because otherwise Apache will apply the rewriting rules
    # to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
    DirectoryIndex app.php
    
    # By default, Apache does not evaluate symbolic links if you did not enable this
    # feature in your server configuration. Uncomment the following line if you
    # install assets as symlinks or if you experience problems related to symlinks
    # when compiling LESS/Sass/CoffeScript assets.
    # Options FollowSymlinks
    
    # Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
    # to the front controller "/app.php" but be rewritten to "/app.php/app".
    <IfModule mod_negotiation.c>
        Options -MultiViews
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>
    
    # # av:php5-engine
    AddHandler av-php54 .php
    Ultima modifica di karl94 : 10-05-2016 alle ore 02.12.50 Motivo: Formattazione

  11. #11
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Nel tuo caso hai il file app.php all'interno della cartella web. Prova a sostituire %{ENV:BASE} con web ed aggiungere la direttiva
    Codice:
    RewriteBase /
    subito sotto a RewriteEngine On.

  12. #12
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    Ho scritto cosi nel .htaccess;

    Codice:
    RewriteRule ^ web/app.php [L]
       RewriteBase /
    ed ora mi da questo errore:


    Parse error: syntax error, unexpected '{' in /membri/letsolveit/var/bootstrap.php.cache on line 2111
    Ultima modifica di karl94 : 10-05-2016 alle ore 15.33.10 Motivo: Formattazione

  13. #13
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Attiva PHP 4.6.

  14. #14
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    grazie, adesso funziona parzialmente, se metto nella barra dell'URL il link messo nei controller mi viene dato l'errore 404!
    da tener conto che ho questo controller:

    Codice:
    <?php
    namespace AppBundle\Controller;
    
    use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
    use Symfony\Component\HttpFoundation\Response;
    use Symfony\Bundle\FrameworkBundle\Controller\Controller;
    
    
    class testController2 extends Controller
    {
        /**
         * @Route("/lucky/number2")
         */
        public function numberAction() {
             return new Response('<html><body>Result: test</body></html>');
        }
    }
    Questi sono i link che ho digitato:

    http://letsolveit.altervista.org/web/lucky/number2
    http://letsolveit.altervista.org/lucky/number2

  15. #15
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Non sono pratico di questo framework. Hai provato a chiedere nei loro canali di supporto ufficiali?

  16. #16
    franco7scala non è connesso Neofita
    Data registrazione
    06-07-2010
    Messaggi
    15

    Predefinito

    No, ma non credo che il problema sia sul codice poiché sulla mia macchina funziona tranquillamente!

Tags for this Thread

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •