I developed a project in Laravel 5.1. In Localhost everything works fine, but when I upload to the client server, which is not shared and is running PHP 5.6, it does not work.
The HTTP ERROR 500
error appears.
Can anyone help me?
I developed a project in Laravel 5.1. In Localhost everything works fine, but when I upload to the client server, which is not shared and is running PHP 5.6, it does not work.
The HTTP ERROR 500
error appears.
Can anyone help me?
If someone has the same problem I followed then how did I solve it?
I created a .htaccess file 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]
No need to change anything else.
Generally, this occurs because in Produção
the error is disabled.
The Blank Page error
If only a blank page or Erro 500
is appearing, I like to do the following tests:
> php artisan
Or
> php public/index.php
If for example only a "blank page" is appearing, the error that is generating it will appear on the command line when running the above tests.
Uninstalled dependencies
Another thing that should be evaluated is dependências
.
If you are GIT
like me to track server changes, you will generally choose to leave the vendor
folder skipped in the repository. So in this case, you should run the command composer install
, if your environment does not already contain the vendor
folder. In other cases, it is always good to use composer dump -o
.
** Error log **
Another thing is that in production environment, it is always good to leave the errors off. If you want to know the problem occurred in production, you can consult the laravel error log.
The log is in the following path:
app/storage/logs/laravel.log