I have problem upload Laravel to hosting cpanel,after that i try to open "mydomain.com/mahasiswa" just Blank Page
this myfolder in the directory public_html
this myfolder in the first directory
this is my code index.php in folder public
<?php
use IlluminateContractsHttpKernel;
use IlluminateHttpRequest;
define('LARAVEL_START', microtime(true));
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
require $maintenance;
}
require __DIR__.'/../mahasiswa/vendor/autoload.php';
$app = require_once __DIR__.'/../mahasiswa/bootstrap/app.php';
// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
});
$kernel = $app->make(Kernel::class);
$response = $kernel->handle(
$request = Request::capture()
)->send();
$kernel->terminate($request, $response);
i try to change position directory public item to mahasiswa first directory and i the another folder same like that to i changed but it can’t solved
i wish the process deploy is successfully and not the blank page
2
Answers
Follow below steps to upload Laravel project on shred hosting only.
First of all you don’t need to alter directory structure of your project, just keep the original folder structure provided by the Laravel.
instead of yourdomain.com put your original domain name.
after this your complete .htaccess should look like this.
Also check the php version of your server and your project
Laravel application deployment on a Sub-domain is easier than sub-directory with cPanel Hosting
Just create a sub-domain and document root like subdomain.yourdomain.com/public
Upload all files of the Laravel application after successful upload just delete everything inside the bootstrap/cache folder
I hope this is helpful for you.