sharkyenergy
sharkyenergy

Reputation: 4173

Laravel - Public_path() on live server

I have uploaded my laravel Site to my host..

My Structure is this:

/home/username/mylaravelproject/ <- contains everything
/home/username/public_html/ <- contains my public folder

so basically I moved my public folder to ../public_html/

Now my Public_Path() function does not work properly.

I tried a few different posts, and the one with the closes result was this one: How to change public folder to public_html in laravel 5

but it returns a wrong path...

It returns this: "/home/username/mylaravelproject/public_html/"

What am I supposed to do in order to configure it properly so that artisan works and the function in php too?

Upvotes: 0

Views: 949

Answers (1)

Melchior Kokernoot
Melchior Kokernoot

Reputation: 63

These kind of issues often rise up when migrating installations. I think you can solve it by reconfiguring your htaccess file (in case your webserver is running apache) as shown here: https://www.webhostface.com/kb/knowledgebase/laravel-public-folder/.

Otherwise, to answer your question concretely: Since you already have a function outputting this part correctly: /home/username/mylaravelproject/public_html/ Why not rebind path.public to the function you used to get this output + "public/".

Although this might not be the nicest solution, and I'm sure there's better ones, this will probably work

Upvotes: 0

Related Questions