0xmtn
0xmtn

Reputation: 2670

PHP website does not work, and nothing logged in the error log

I have a problem with PHP. There is an error that I have never encountered before. The home.php, which is the main page of my site, cannot be viewed. And there is nothing in error log. After there is an inclusion of a php page (a class that is a part of my API). Till that line the holl HTML (javascript and css inclusions) are echoed from php and successfully rendered in browser, but after the php kind of stops suddenly. When I delete that line(php page inclusion line), website works, but before, this inclusion didn't make any problem for me. I removed the code parts which after them I encountered this problem, but nothing works.

I am using Apache2, PHP5 with Ubuntu 11.10.

Any help will be appreciated, thanks in advance.

Upvotes: 0

Views: 259

Answers (1)

Timo
Timo

Reputation: 935

My first hints would be to check the following:

  • In your script set ini_set('display_errors', '1'); and error_reporting(E_ALL); to display all errors.
  • Turn on the php error log and check it for errors.
  • run php -l home.php on the command line to check your php file for syntax errors.
  • Check Apache's error log, sometimes error messages go there.

If nothing helps use a debbugger like XDebug to see where the script terminates, or alternative insert statements like die("here"); and move them around in your code, to see which parts of your scripts are passed.

Greetings and good luck.

Upvotes: 4

Related Questions