Deploy laravel project (Voyager admin) on shared hosting

Posted: 26-05-2019 | Views: 6397
Deploy laravel project (Voyager admin) on shared hosting

I will cover the following here:

1.Compress the entire project folder on your local machine. You'll get a zip file –

2.Upload the to the root directory – the public_html.

3.Extract the here.

4.Create a database on your web host.There's easy way of importing and exporting databases from a local machine.login to PHPMyAdmin from your computer locate the database your project uses, from the toolbar find the export tool.

5.Open .env file. Change APP_URL=yourdomain and Database name and user

6.IMPORTANT ! first remove storage folder from "public_html/public", then create file for example link.php in public_html/ directory and add below lines

$targetFolder = $_SERVER['DOCUMENT_ROOT'].'/storage/app/public';
$linkFolder = $_SERVER['DOCUMENT_ROOT'].'/public/storage';
echo 'Success';

7.Then get

8.Create .htaccess file for (the public_html.). add below lines

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteCond %{REQUEST_URI} !^public/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ public/$1
RewriteCond %{HTTP_HOST} ^(www.)?$
RewriteRule ^(/)?$ public/index.php [L]

9.Everyting is ok.Deploy completed.


Add comment