For those who are awake!
Discount -15%
We use cookies
We use cookies to optimize our website. By continuing to browse the site, you agree to our use of cookies.
New design
Control panel
  • Русский
  • Українська
  • English
  • UAH
  • USD
  • RUB
  • EUR
  • 0-800-307-307 Hotline
  • +38 (044) 392-74-33 Kiev
  • +38 (057) 728-39-00 Kharkiv
  • +38 (056) 794-38-31 Dnipro
  • +38 (032) 229-58-93 Lviv
  • +38 (048) 738-57-70 Odessa
  • +38(093) 170-15-42  Life
  • +38 (067) 400-88-44 Kievstar
  • +1(888)393-24-51  USA, Toll free
  • +44(131)507-01-14  Great Britain
  • +7 (499) 348-28-61 Moscow

2.14.2.1. Installing Laravel

Here are two ways to install the base Laravel 7 scripting package and dependent libraries. The instruction is based on official documentation.

To install Laravel, do the following:
  1. By default, surrounded by SSH the hosting uses PHP 5.6. According to the requirements of the framework, a version of at least 7.3 is required, so override the paths in the variable $PATHby running the command:
    export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
  2. Download the installer:
    composer global require laravel/installer
  3. Define the path to your Laravel executable so that it runs from any directory on the filesystem:
    export PATH="$PATH:~/.config/composer/vendor/bin"
  4. Change to the desired directory and create a new project:
    laravel new name_theproject
To install Laravel, do the following:
  1. By default, surrounded by SSH the hosting uses PHP 5.6. According to the requirements of the framework, a version of at least 7.3 is required, so override the paths in the variable $PATHby running the command:
    export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
  2. Run the command:
    composer create-project laravel/laravel ~/way/to/catalog/theproject

If the root directory of the site is different from www (usually Laravel project files are located in the directory public), then you can set the desired root directory in site settings or write the following directives in the file .htaccess:

# www/.htaccess
 
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule ((?s).*) public/$1 [L]
</IfModule>

Also (if the root directory is specified via .htaccess) you need to create a .htaccess file in the directory public and write the following directives in it:

# www/public/.htaccess
 
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^((?s).*)$ index.php?_url=/$1 [QSA,L]
</IfModule>