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

Mikejs's avatar

Trying to install Laravel app on hosting

Hi I hope someone can help me I have an application that uses the Laravel framework I have uploaded the main app to a folder on my host named script I have set my www.domain.com folder to use public as its root

so I have a folder structure like this:

/ script public

I have set the file paths in my index,php file to:

require DIR.'/../script/bootstrap/autoload.php'; $app = require_once DIR.'/../script/bootstrap/app.php';

When I run the script installer it asks me to set the script/public folder to be writable so it looks like the installer is not seeing the correct path.

In my installerRepository.php I have these lines

//this function creates all required directories for theme in public folder
public function createDir($theme)
{
    if(!Storage::has('/public/themes/'. $theme))
        Storage::makeDirectory('/public/themes/'. $theme);
}

//copy assets contents to themes/{theme} folder
public function copyAssets($theme)
{
    $src  = base_path()."/resources/views/themes/{$theme}/assets";
    $dest = public_path()."/themes/{$theme}";

Which I presume will copy the contents for the themes to the public folder so the site will display correctly

is there a way to set the new path for the installer to use

thanks

Mike

0 likes
3 replies
jaydeluca's avatar

I believe the error you are getting is due to there not being an autload file generated by composer. Can you run composer install on your hosting? (if you can, you should) otherwise you'll need to run it locally and then make sure to upload the vendor directory

lifesound's avatar

Give the right permission to the public folder , 755 perms

mushood's avatar

Hello

When I had the same issue, here are 3 step checklist I used:

  1. Modify the index.php file in the public folder correctly. You can find this simple guide useful too https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e

  2. Verify that the php version on my host is correct with the version of laravel I am using

  3. Check that permissions for folders is 755 and 644 for files

Hope this helps someone

Please or to participate in this conversation.