HTTP 500 error when putting an orange project5.1 into production

Asked

Viewed 1,956 times

2

I developed a project in Laravel 5.1.In Localhost everything works fine, but when I go up to the client server, which is not shared and is with PHP 5.6, it doesn’t work. Error appears HTTP ERROR 500.

Can someone help me?

  • Just looking at the PHP log, if you have a look at Cpanel, but you probably missed some extension being enabled or the php version is older than 5.6. Just the log to be sure

  • In Log ta saying that the problem is in index.php on these 2 lines require DIR.'/../bootstrap/autoload.php'; app = require_once DIR.'/../bootstrap/app.php';

  • Puts the error in the question exactly the way it is written.

2 answers

1

Generally this occurs because in Produção the error is disabled.

The Blank Page Error

If only a blank page is appearing or Erro 500, i like to do the following tests:

> php artisan 

Or else

> php public/index.php

If for example only "a blank page" appears, the error that is generating it will appear in the command line when running the above tests.

Dependencies not installed

Another thing that should be evaluated are the dependências. If you are the GIT as I to control server changes, will usually choose to leave the folder vendor ignored in the repository. Then, in this case, you must execute the command composer install, case in your environment does not yet contain the folder vendor. In other cases, it is always good to use the composer dump -o.

** Error log**

Another thing is that, in production environment, it is always good you leave the errors disabled. If you want to know the problem occurred in production, you can check the log of errors.

The log is on the following path:

 app/storage/logs/laravel.log

1


In case someone has the same problem I’m still there as I was able to solve.

I created a file .htaccess with the following code.

RewriteEngine on
RewriteCond %{HTTP_HOST} ^meusite.com.br$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www. meusite.com.br$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

Without having to change anything else.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.