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

LaylowZK's avatar

Server Error 500

Hi guys, i'm a beginner in Laravel, it has been 10 days i'm try to getting started this framework and nothing until, all because this error: "Server error 500 The website encountered an error while retrieving http://localhost:8888/Putamerda/public/. It may be down for maintenance or configured incorrectly." Please, somebody help me, i've tried everything and nothing...

0 likes
10 replies
LaylowZK's avatar

Sorry about the name link for the people who understand portuguse, but this is the real name for the app i'm trying to develop!

1 like
bashy's avatar

In .env file, do debug to true and tell us if you see anything different. If you don't, here's some pointers;

  1. Check folder permissions - check here: https://laravel.com/docs/5.2/installation under directory permissions
  2. Make sure you've got a key generated in the .env or similar. php artisan key:generate to generate it into .env file.
  3. Check any logs you have access to if the above fail.

You should let us know what you're using to host the website (locally).

LaylowZK's avatar

Thank you for your answers...

I'm using Xamp 7.0.3-1/ PHP 7.0.3; Apache 2.4.16

Dear Bashy, as i said you, i'm a beginner in Laravel and i still don't know some basic things like the .env location

joedawson's avatar

The .env file will be in the root of your application. If not, there should be a .env.example file - rename this to .env

In this .env file, you should have the following line:

APP_DEBUG=true

If not, add it and see if you see any further errors when you try viewing your application.

1 like
LaylowZK's avatar

Hi guys, this is the appearance of my .env file

APP_ENV=local APP_DEBUG=true APP_KEY=9pwOv7LhZiia9jLXE7DROdfJ0oX3fUlY

DB_HOST=127.0.0.1 DB_DATABASE=homestead DB_USERNAME=homestead DB_PASSWORD=secret

CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync

REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379

MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null

I did every thing you said and still nothing working. Bashy i did not understand the steps 2 and 3 you wrote up! Can you explain for a very beginner?

thefuzzy0ne's avatar
Level 6

Normally, a 500 error means that there is some kind of problem with your .htaccess file (in your public directory) or possibly the web.config file (in the same directory). Have you changed any of these?

I also remember that getting some .htaccess files to work on XAMPP was a royal painus in the anus. You may be better off using Homestead, or running

php artisan serve

2 likes
LaylowZK's avatar

Many Thanks thefuzzy0ne, your tip mad my first app in Laravel run. I Would like to finish the the discuss in your post but i cant because i still want i make it run in XAMP

10000 X Likes and Thanks thefuzzy0ne.

willvincent's avatar

You need to configure the webserver to use the public directory as it's docroot.

Then you should probably also set up an entry in your hosts file so you can access the site by named url, rather than 'localhost'

Homestead aims to make all of that more straightforward, might be worth a look.

extjac's avatar

If i were you I would do the following

  1. update your host file (C:\Windows\System32\drivers\etc) and add this:
127.0.0.1 putamerda.local
  1. Update the httpd-vhosts.conf file (C:\xampp\apache\conf\extra) add this: ( I am assuming that you folder is called "putamerda" and located on your c:\xampp\htdocs\
<VirtualHost *:80>
    DocumentRoot "C:/xampp/htdocs/putamerda/public"
    ServerName putamerda.local
</VirtualHost>

3- Start your Xampp control panel . Stop/Start apache.

4- Open your web broswer and type http://putamerda.local

good luck!

Please or to participate in this conversation.