Laravel White Index Of / Page错误

I have just uploaded a laravel project from development server to live server direct into the /public_html folder

copied it over like for like and now when i go to the website it brings up a white page which shows the folder structure - index of/ - and not the website

what do i need to change to fix this issue?

If you have the ssh access to your account in shared hosting you could do something like this:

  1. Upload the project outside the public_html.
  2. Symlink the public_html with public directory of laravel.

You might have the directory structure like this in your hosting account:

|-your-account
    |-public_html
        |-index.html    

You need to make it like this:

|-your-account
    |-project-directory
        |-public
        |-vendor
        |-....   
    |-public_html
        |-index.html    

Now, you could delete the public_html using:

rm -rf ~/public_html

Then create the symlink to the public_html using:

ln -s /home/your-account/project-directory/public /home/your-account/public_html

where:

your-acccount = your shared hosting account name

project-directory = your laravel project directory

If you are using cPanel and don't have ssh access, you could try running the command in Cron Job like:

https://www.siteground.com/tutorials/cpanel/cron_jobs.htm

https://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/

If there is some error on storage permission you might need to recreate the folder inside the storage/framework and give it the permission of 755.

Hope it suits your need.