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

muathye's avatar
Level 41

deployment of laravel in shared hosting issue

After I deployed my laravel project to a shared hosting from bluehost, as this tutorial https://dev.to/asapabedi/deploying-laravel-5-applications-on-shared-hosting-without-the-use-of-ssh--16a6 now I can not upload files to public_html it upload them to public directory which outside public_html

0 likes
2 replies
jlrdw's avatar

Use move

$file->move($destinationPath, $fileName);

$destinationPath is a variable you create to the path you want.

Change to your variable names as needed.

seen's avatar
seen
Best Answer
Level 4

Go Config/filesystem.php and modify

'public' => [
            'driver' => 'local',
            'root' => storage_path('app/public'),
            'url' => env('APP_URL').'/storage',
            'visibility' => 'public',
        ],

to be like

'public' => [
            'driver' => 'local',
            'root' => public_path('/../../public_html'),
            'url' => env('APP_URL').'/public',
            'visibility' => 'public',
        ],
1 like

Please or to participate in this conversation.