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

shem's avatar
Level 1

i have a problem of uploading files to my public folder after hosting my project online

I have my public directory named public_html instead of public on my Cpanel. So where do I change this setting? Uploading files uses $this->app['path.public'], but that package is trying to use public instead of what I want, public_html. So how do I tell Laravel 6 to use public_html?

0 likes
6 replies
shem's avatar
Level 1

you didnt understand the question

fylzero's avatar

Try using the public path helper.

public_path()

23 likes
Snapey's avatar

if you can create symlinks then it's possible to delete the public_html folder and recreate it as a symlink to public folder

Your web server will still serve the public_html folder but content will come from public

The problem really stems from the fact that public folder is hard coded into the helper

jlrdw's avatar

You can store images where you want, just specify the path.

Example:

public_html/uploads/myimages
//or
public_html/img
// whatever folder you see fit to use.

You can have other sub folders with images, which most do. You have to learn to work with paths in php however.

like

realpath(dirname(__FILE__))

Using laravel this is something you should know already.

Please or to participate in this conversation.