Hafiz
Hafiz

Reputation: 4267

Having 500 Internal server error on any error on amazon hosting

I am working on amazon hosting using Kohana 3.x , PHP, and when there comes an error , it instead of showing error , it gives 500 internal server error. Due to which I have to debug my code on localhost but many times error come online only because many things can only be tested online then in that case I have to test it by commenting some part of code or line by line. So is there a way that instead of 500 internal server error it gives me actual PHP error or Kohana error that would be more helpful.

thanks in advance for your time guys.

Upvotes: 1

Views: 8540

Answers (3)

matino
matino

Reputation: 17725

  1. First of all never show PHP errors on a production website!
  2. Implement your own HTTP error pages - http://kohanaframework.org/3.2/guide/kohana/tutorials/error-pages
  3. Setup bootstrap.php for production:
    Kohana::$environment = Kohana::PRODUCTION;
    error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
  4. Kohana comes up with built in error logging feature. Every HTTP error (404, 403, 500 etc) is automatically saved in application/logs/month/day.php file. Open this file and check what was the reason for error.

Upvotes: 1

Jan Dragsbaek
Jan Dragsbaek

Reputation: 8101

I have experienced that in some cases my server will throw a 500 error (even with small stupid errors) if i dont apply these.

ini_set('display_errors', 1);
error_reporting(E_ALL);

Try applying these in the start of your code.

Upvotes: 4

Matej Janovčík
Matej Janovčík

Reputation: 1262

Are you using .htaccess file? It use to cause 500 internal server errors. Also check your server error logs

Upvotes: 0

Related Questions