installing laravel app on addon domain with shared hosting

installing laravel app on addon domain with shared hosting

I've searched up and down and while there are a lot of the same solutions out there that show how to do this, none of them seem to be working (surely, I having something configured wrong here).

I've searched up and down and while there are a lot of the same solutions out there that show how to do this, none of them seem to be working (surely, I having something configured wrong here).

I am trying to deploy a laravel app on an addon domain with shared hosting.

I have uploaded my app (all but the public folder) along side the public_html folder (same level, not inside it).

Structure: https://imgur.com/a/fiyGxzC

I've taken everything from the public folder and put it inside a folder on the addon domain.

Ex.: public_html/mysite.com/laravel/

Note that I've substituted my actual username and domain with placeholders here (obviously)

This is where it gets tricky for me. I've tried adjusting the paths in the public_html/mysite.com/laravel/index.php file, but the DIR method/command seems to be grabbing from the wrong directory and I get the following errors:

Warning: require(/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php): failed to open stream: No such file or directory in /home1/username/public_html/mysite.com/laravel/index.php on line 22

Warning: require(/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php): failed to open stream: No such file or directory in /home1/username/public_html/mysite.com/laravel/index.php on line 22

Fatal error: require(): Failed opening required '/home1/username/public_html/mysite.com/laravel/../../laravelapp/bootstrap/autoload.php' (include_path='.:/opt/php71/lib/php') in /home1/username/public_html/mysite.com/laravel/index.php on line 22

Do note that I've tried modifying to document root by trying it with a subdomain, but ran into the same type of errors.

Also note that when I put the entire app (including public) inside a folder inside the addon domain (ex.: mysite.com/testing), I was able to get things working, but the images and styles would not load. I know this is a security risk, so I'm trying to do it the correct way now and get everything running smoothly.

Some help here would be greatly appreciated - been on this for 2 days now. Thanks a lot! Sorry for any redundancy here.

Edit: I've also tried modifying my path in the server.php (this was suggested on another solution) to "../public_html/mysite.com/laravel/index.php" and to no avail as well.

php laravel

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Php how to delete multiple rows through checkbox using ajax in laravel

In this article i will let you know to delete multiple rows through checkbox using ajax in laravel and before delete we will give a confirmation message.

5 Laravel’s Hidden Gems

Spread the love1. Stop on first validation error By default, Laravel will check for all validation rules and return a list of errors. But if you want to stop this process after first validation failure, that’s how you can achieve…Read More→

Some of the most frequent how tos in Laravel

Spread the loveHow to get relationship from relationship using With() in Laravel Some times there are cases where you want to get relationship from relationship in Laravel, that can be achieved via following: How to create multiple where clauses in…Read More→

10 Laravel Quick Tips

Spread the loveTip 1. Controllers Having Single Action In some situations you need a single action in a controller, if this is the case in Laravel you can achieve it by __invoke() method. Routes: Artisan command to generate this controller:…Read More→

Laravel Sanctum vs Passport

After the Laravel Sanctum package was released? Everywhere question was asked that When to use Sanctum and when to use Passport? So, in this video, you will ...