Here are two ways to install the base Laravel 7 scripting package and dependent libraries. The instruction is based on official documentation.
$PATH
by running the command:export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
composer global require laravel/installer
export PATH="$PATH:~/.config/composer/vendor/bin"
laravel new name_theproject
$PATH
by running the command:export PATH=/usr/local/php73/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin
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>