Laravel 5.3 Internal Server Error After Installation

Recently for one of my project I have installed Laravel 5.3 on server but after installation when I tried to run it in web it was showing 500 Internal Server Error so I had to spend few hours in resolving it so here in this blog I am going to explain what was the issue and how I solved it.

1) Find out the Error.

I looked into to server logs from cPanel and found out following error.

SoftException in Application.cpp:429: Mismatch between target UID (501) and UID (99) of file “/path/larravel/public/index.php”

After searching for sometime about this error I figured out that the apache or web user was not owner for the files because I created laravel project through SSH so the logged in SSH user was the owner of the files and folders.

So when apache or web user tried to access the files it was not working. So the solution was to change the ownership of files and folders to apache user.

2) Find out the username of apache user.

In most cases user name of apache user should be www-data or apache or apache2 but in my case since I was using VPS the username was different. So run following command in terminal through SSH

ls -l

It will give you file list with user and group owner. That’s your web username. Now change the ownership of folder to this username.

chown -R username:username laravel

That’s it. Now run your laravel project and it shall display following screen.

That means your laravel project is working fine on the server. Hope this helps you.

This entry was posted in Laravel, Laravel 5.2, PHP, PHP Extensions, PHP Framework on by .

About Hiren Dave

Hiren Dave is a software engineer, blogger and consultant with over 9 years of professional experience. He writes code in number of languages. Hiren has a passion for developing web apps, mobile apps and writing books and blog articles about programming. He has a solid experience of startups as he manages products for few startups. He is also passionate about researching and learning new technologies and trends. He has also authored a book Instant Sencha Touch, published by Packt and creator of Video Course "Beginning Laravel" for Packt

Leave a Reply

Your email address will not be published. Required fields are marked *