Solution:1
How to Fix it?
- Zipping your Lumen Project
- Go to your shared hosting file manager
- I assume your shared hosting file manager have this directory structure like
/home/username/public_html
. - Create a folder outside public_html or htdocs, the folder name is up to you, example “myfolder” the structure looks like
/home/username/myfolder
- Upload your project to the new folder you have been created and unzip.
- After unzip, inside the “myfolder” there is a folder named “public”, move the contents inside to
For Main Domain
/home/username/public_html
For Subdomain or Subfolder
/home/username/public_html/sub
- After moving those files, edit the
index.php
inside/home/username/public_html
or/home/username/public_html/sub
- Inside the file you see this code
$app = require __DIR__.'/../bootstrap/app.php';
change the code to
For Main Domain
$app = require __DIR__.'/../myfolder/bootstrap/app.php';
For Sub Domain/Subfolder
$app = require __DIR__.'/../../myfolder/bootstrap/app.php';
Don’t forget to edit the APP_URL in .env
file inside “myfolder”
Example the APP_URL .env
file
APP_URL=http://yourdomain.com or http://sub.yourdomain.com or http://yourdomain.com/sub