2.8.4.2.1. Install Laravel

  1. Set the required PHP version for the site and console (see official requirements).
  2. Connect to the hosting via SSH.
  3. Install Laravel using one of the following methods:
    1. Download the installer:
      composer global require laravel/installer
    2. Set the path to the Laravel executable file so that it can be run from any directory in the file system:
      export PATH="$PATH:~/.config/composer/vendor/bin"
    3. Go to the desired directory and create a new project:
      laravel new project_name
    Execute the command:
    composer create-project laravel/laravel ~/path/to/project/directory
  4. Project files are usually located in the public directory, so change the site's root directory in one of the following ways:
    Change the site root directory so that it points to the public directory.
    Add two files .htaccess:
    1. In the site's root directory:
      <IfModule mod_rewrite.c>
      RewriteEngine on
      RewriteRule ^$ public/ [L]
      RewriteRule ((?s).*) public/$1 [L]
      </IfModule>
    2. In the public directory:
      <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
      </IfModule>
Content

    (7)

    Comments

    dudnik1986
    Не рабочий вариант перенаправления
    karlov
    Могли бы вы уточнить, какой именно вариант не работает и как конкретно проявляется проблема?
    karlov
    Директивы, указанные в статье, рабочие и проверенные. Если с ними вы не получаете ожидаемого результата, обратитесь в онлайн-чат для проверки ситуации.
    girpilius
    дуже шкода що такі жахливі "інструкції" допускають до читання людям
    karlov
    В інструкції описані мінімально необхідні дії для встановлення Laravel на хостингу. З якими труднощами ви зіткнулися?