Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mahammadsxiyev's avatar

Laravel files directory

Hi, when i create subdomain in hosting hosting create subdomain public in public html. public_html/sub_public_html. i upload laravel files /laravel root folder and change index directory to /laravel/public_html/sub_public_html but not work

0 likes
4 replies
mahammadsxiyev's avatar

@zoidq referance link not work. sub_public is my subdomain public folder public_html is my web site public folder. I want access laravel vendor and bootstrap folder in index.php like this require __DIR__.'/laravel/public_html/sub_public/vendor/autoload.php'; but not work

Snapey's avatar

and anyone can print out your .env file... is that ok?

mahammadsxiyev's avatar
mahammadsxiyev
OP
Best Answer
Level 1

Ok, I solved


$vendor_path = realpath("/home/hosting/laravel/vendor/autoload.php");
$bootstrap_path =  realpath("/home/hosting/laravel/bootstrap/app.php");

require $vendor_path;
$app = require_once $bootstrap_path;

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

Please or to participate in this conversation.