Skip to content

Instantly share code, notes, and snippets.

@imam932
Last active October 24, 2022 15:57
Show Gist options
  • Save imam932/d51377586e128a25e162ed11850330a6 to your computer and use it in GitHub Desktop.
Save imam932/d51377586e128a25e162ed11850330a6 to your computer and use it in GitHub Desktop.
Step to upload laravel to shared hosting
1. Bundling project in local to zip file
2. Upload to Cpanel
3. Unzip to your root dir hosting (domain or sub domain)
4. Setup database
```
DB_DATABASE=db_name
DB_USERNAME=root
DB_PASSWORD=password
```
5. Open Terminal and Install composer
```
composer install
```
6. Generate new key
```
php artisan key:generate
```
7. Generate Tables
```
php artisan migrate
```
8. Insert datas using seeder
```
php artisan db:seed
php artisan laravolt:indonesia:seed
```
9. in root dir added index.php file and write this :
```
<?php
header('Location: public/');
?>
```
10. in root dir add .htaccess file and write this :
```
<IfModule mod_rewrite.c>
RewriteEngine On
# Force SSL
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Remove public folder form URL
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
```.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment