'How should I properly develop laravel app on hosting

I'm trying to develop Laravel project on hosting server, but I have a problem with public_html/index.php

Structure of files is:

/laravel/(all laravel files except /public)
/public_html/(all files from laravel /public folder)

File /public_html/index.php (without comments):

<?php

use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;

define('LARAVEL_START', microtime(true));

if (file_exists(__DIR__.'/../laravel/storage/framework/maintenance.php')) {
    require __DIR__.'/../laravel/storage/framework/maintenance.php';
}

require __DIR__.'/../laravel/vendor/autoload.php';

$app = require_once __DIR__.'/../laravel/bootstrap/app.php';

$kernel = $app->make(Kernel::class);

$response = tap($kernel->handle(
    $request = Request::capture()
))->send();

$kernel->terminate($request, $response);

And I'm receiving following problem:

Warning: PHP Startup: failed to open stream: No such file or directory in /index.php on line 34

Fatal error: PHP Startup: Failed opening required '//../laravel/vendor/autoload.php' (include_path='.:/:/usr/local/php74/lib/pear') in /index.php on line 34

I'm accessing website by https://my_domain.com.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source