How to Change public To public_html On Laravel 5 Ubuntu

Laravel 5 has different level from previous version. It becomes simpler and it has different file structure. That was making me confused at the first time when I was trying to migrate from previous version. The odd is bootstrap/paths.php doesn’t exist anymore. Now, how do I set the public folder of my project to desired one?

I thought it was simple, but lately I can’t find the settings are. I found it blank page after I changed the public folder to public_html. Then I tried to look up the public/index.php. I found something interesting about how it processes the index.php itself. It made me come to the conclusion that I don’t need to set any configuration to get public folder to public_html works.

Then why I saw the blank page? Well, I am not a programming Guru, but I knew what’s happening there. It looks like Laravel processes it files first before it’s ready to be served to users. That’s why Laravel need folder to store the processed files. It is called storage folder.

I checked the storage and I found it has no write permission for the application. So, I changed it to 777 recursively. Then, it works.

Damn. I forgot to mention that I was using Apache web server to serve Laravel 5. But, if you are going to use php artisan serve command all I’ve mentioned above won’t work. Instead, use the Wood Marks way. Thanks to him.

Leave a Reply