this laravel project works smoothly on local but I cant figure out how to run it on server, I tried so many tricks, nothing worked
I uploaded the whole project on root(directory above the public_html) inside a folder named laravel,I did everything about database and .env
then I moved content of public folder to public_html directory and set the path inside index.php __DIR__.'/../laravel/vendor/autoload.php';, and also for path to bootstrap and storage
server runs on liteSpeed, here is the .httaccess codes
<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]
index.php
<?php
use Illuminate\Http\Request;
define('LARAVEL_START', microtime(true));
// Determine if the application is in maintenance mode...
if (file_exists($maintenance = __DIR__.'/../laravel/storage/framework/maintenance.php')) {
require $maintenance;
}
// Register the Composer autoloader...
require __DIR__.'/../laravel/vendor/autoload.php'; // bootstrap folder of laravel is ther
// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../laravel/bootstrap/app.php')
->handleRequest(Request::capture())
;
but I still get HTTP ERROR 500 on web page and siteurl/public automatically adds to URL(/public)!
and inside cPanel in a txt file named error_log, I get
[15-Jun-2024 15:14:17 UTC] PHP Warning: require(/home/klassir2/public_html/../laravel/vendor/autoload.php): Failed to open stream: No such file or directory in /home/klassir2/public_html/index.php on line 13
has anybody successfully deployed laravel11 with inertia.js on shared hosting?
thank you



composer install.index.phpand it's locationcomposer installbefore uploading to cpanel ? Remember, you have to runcomposer installbefore uploading the app to the panel, because the CPANEL doesn't have composernpm run buildbefore uploading your app to the CPANEL. The steps would be: runcomposer install-> runnpm run build-> deletenode_modulesfolder -> upload the app to the panel using the same directory that you use before in your question.htaccessfile