Expert Website & App Developer | Jasa pembuatan website, pengembangan aplikasi Android sesuai dengan kebutuhan Anda

HomeDocsPanduan Deploy Proyek Laravel di Hosting DealTech

Panduan Deploy Proyek Laravel di Hosting DealTech

View Categories

Panduan Deploy Proyek Laravel di Hosting DealTech

1 min read

Cara Install Laravel di Hosting DealTech

  1. Upload File Laravel ke public_html
    Gunakan File Manager atau FTP untuk mengupload seluruh file Laravel ke folder public_html.
  2. Atur Permission Folder
    Jalankan perintah berikut lewat SSH atau gunakan fitur Fix Permission di CyberPanel:

    chmod -R 775 storage
    chmod -R 775 bootstrap/cache
  3. Agar URL Tidak Harus /public
    Buat dua file di dalam public_html: index.php dan .htaccessIsi file .htaccess:

    <IfModule mod_rewrite.c>
        RewriteEngine On
        RewriteRule ^(.*)$ public/ [L]
    </IfModule>

    Isi file index.php:

    <?php
    define('LARAVEL_START', microtime(true));
    require __DIR__.'/public/index.php';
  4. Ubah file .htaccess di dalam folder public
    <IfModule mod_rewrite.c>
        <IfModule mod_negotiation.c>
            Options -MultiViews -Indexes
        </IfModule>
    
        RewriteEngine On
    
        # Handle Authorization Header
        RewriteCond %{HTTP:Authorization} .
        RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect Trailing Slashes If Not A Folder...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_URI} (.+)/$
        RewriteRule ^ %1 [L,R=301]
    
        # Send Requests To Front Controller...
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteRule ^ index.php [L]
    </IfModule>

Tambahan: Jika Perintah storage:link Tidak Berfungsi
Gunakan command berikut sesuai versi PHP yang Anda pakai (contoh PHP 8.2):

/usr/local/lsws/lsphp82/bin/php artisan storage:link

Ganti lsphp82 sesuai dengan versi PHP Anda.

Semoga sukses deploy Laravel Anda di CyberPanel!

 

Sumber Referensi:

  • Penulis: Cahrur RozidCahrur.net

  • Edit & Format Ulang oleh: DealTech

Url Versi Asli : https://cahrur.net/panduan-deploy-proyek-laravel-di-cyberpanel/

 

Powered by BetterDocs