Skip to content
Advertisement

How to change public folder to public_html in laravel 5

I’m using a shared hosting which uses cPanel as its control panel and within the cPanel public_html is the default root directory, because of this I can’t get my Laravel application work properly.

Is there any way to make Laravel use public_html instead of public folder?

Advertisement

Answer

Quite easy to find this with a simple search.

See: https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5

In your index.php add the following 3 lines.

JavaScript

Edit:


As Burak Erdem mentioned, another option (and more preferable) is to put this in the AppProvidersAppServiceProvider register() method.

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement