Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Laravel on AlterVista (and Wordpress)

  1. #1
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default Laravel on AlterVista (and Wordpress)

    Hi all,
    thank you for this wonderful free space

    I am looking for the best way to install Laravel on AlterVista and Wordpress, all together:



    The first step is to modify the .htaccess file to have a sub-folder that works with a simple index.html

    Code:
    # BEGIN AV_HTTPS
    ###### ###### ###### ###### ##  DO NOT EDIT!
    ###### ###### ###### ###### ##
    ##       ##   ##  ## ##  ## ##  This is an automatically generated file,
    ##       ##   ##  ## ##  ## ##  any manual change will be lost.
    ######   ##   ##  ## ###### ##
    ######   ##   ##  ## ###### ##  NON MODIFICARE!
        ##   ##   ##  ## ##     ##
        ##   ##   ##  ## ##         Questo è un file generato automaticamente,
    ######   ##   ###### ##     ##  qualsiasi modifica manuale verrĂ  persa.
    ######   ##   ###### ##     ##
    
    # If you think you need to edit this file, please open a new thread in our
    # support forum (http://forum.en.altervista.org/cms/) explaining what you are
    # trying to do.
    
    # Se pensi di aver bisogno di modificare questo file, apri una nuova discussione
    # sul nostro forum di supporto (http://forum.it.altervista.org/wordpress/)
    # spiegando cosa stai cercando di fare.
    
    AddHandler av-php7 .php
    RewriteCond %{HTTP:X-Forwarded-Proto} !=https
    RewriteCond %{HTTPS} =off
    RewriteRule ^ https://laravista.altervista.org%{REQUEST_URI} [L,R=301]
    SetEnv AV_TOOLBAR 0
    
    # END AV_HTTPS
    
    
    # BEGIN WordPress
    # Le direttive (linee) tra `BEGIN WordPress` e `END WordPress` sono
    # generate dinamicamente, e dovrebbero essere modificare solo con i filtri di WordPress.
    # Ogni modifica alle direttive tra questi marcatori sarĂ  sovrascritta.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    Thank you in advance for any good suggestion!

  2. #2
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    688

    Default

    Hello!

    • you need an hosting account (this service is not currently provided worldwide). If you want wordpress too, you need to install it.
    • You need to install Laravel in your computer, then upload the content generated (php, html...).

    • Set PHP7
    • Then open:

      vendor\laravel\framework\src\Illuminate\Support\he lpers.php

      And add after this line:
      Code:
      $value = getenv($key);
      this code:
      PHP Code:
      if ($value === false && isset($_SERVER[$key]))
      {
      $value = $_SERVER[$key];
      }
    • Now Laravel should word correctly.


    Bye!

  3. #3
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default

    Really thank you for your fast reply

    Do you know the way to avoid to see the files into the parent folder? for example in your case you have exposed the secret .env file:

    http://alemoppo.altervista.org/larav...valaravel/.env

    Code:
    APP_NAME=Laravel
    APP_ENV=local
    APP_KEY=base64:2NF+jbAPbcqsT5EOh6VOMrhkAj7ySkWB5pL7GU3EsmQ=
    APP_DEBUG=true
    APP_URL=http://localhost
    
    LOG_CHANNEL=stack
    
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=homestead
    DB_USERNAME=homestead
    DB_PASSWORD=secret
    
    BROADCAST_DRIVER=log
    CACHE_DRIVER=file
    SESSION_DRIVER=file
    SESSION_LIFETIME=120
    QUEUE_DRIVER=sync
    
    REDIS_HOST=127.0.0.1
    REDIS_PASSWORD=null
    REDIS_PORT=6379
    
    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.mailtrap.io
    MAIL_PORT=2525
    MAIL_USERNAME=null
    MAIL_PASSWORD=null
    MAIL_ENCRYPTION=null
    
    PUSHER_APP_ID=
    PUSHER_APP_KEY=
    PUSHER_APP_SECRET=
    PUSHER_APP_CLUSTER=mt1
    
    MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
    MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

  4. #4
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    688

    Default

    You can hide the file via .htaccess.

    Bye!

  5. #5
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default

    Probably I have a new low-level error using the last Laravel version:

    https://laravista.altervista.org/lar...blic/index.php

    Code:
    The Process class relies on proc_open, which is not available on your PHP installation.
    
    Fatal error: Declaration of Symfony\Component\Translation\TranslatorInterface::setLocale($locale)
    must be compatible with Symfony\Contracts\Translation\LocaleAwareInterface::setLocale(string $locale)
    in /membri/laravista/laravel/vendor/symfony/translation/TranslatorInterface.php on line 24

  6. #6
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

  7. #7
    alemoppo is offline AlterVista Staff
    Join Date
    Feb 2010
    Location
    IT
    Posts
    688

    Default

    I'm sorry but the proc_open function is disabled for security reasons.

    Bye!

  8. #8
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default

    Quote Originally Posted by alemoppo View Post
    You can hide the file via .htaccess.

    Bye!
    I found this similar case: Wordpress with Laravel on subfolder

  9. #9
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default

    Here I simulated the same production error into Docker setting this php.ini

    Code:
    disable_functions = putenv
    Quote Originally Posted by alemoppo View Post
    Hello!

    • you need an hosting account (this service is not currently provided worldwide). If you want wordpress too, you need to install it.
    • You need to install Laravel in your computer, then upload the content generated (php, html...).

    • Set PHP7
    • Then open:

      vendor\laravel\framework\src\Illuminate\Support\he lpers.php

      And add after this line:
      Code:
      $value = getenv($key);
      this code:
      PHP Code:
      if ($value === false && isset($_SERVER[$key]))
      {
      $value = $_SERVER[$key];
      }
    • Now Laravel should word correctly.


    Bye!

  10. #10
    laravista is offline Utente AlterBlog
    Join Date
    Dec 2019
    Posts
    45

    Default

    Here probably the best solution using a custom file app/helpers.php instead of modify the vendor:

    PHP Code:
    require __DIR__.'/../app/helpers.php';

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO