0

I've just had a hard time finding a bug in my PHP code described below

<?php
if(condition...)
    {
     do something...
    }
<?php
...more php

Notice that I incorrectly opened a php block again when it was not needed(before the ...more php)

The problem is that PHP is not reporting this error, it's just giving me a blank page. I've set error reporting to E_ALL and ini_set display errors '1'. I was wondering if there is a way to make php report this kind of error.

2 Answers 2

1

This is very common problem, yet a quite simple one.

That's just error reporting settings.
Your server apparently set up to not to display errors (which is the only right behavior on a live server!), but most likely it writing errors in some log file.
You have to find out where this file located and peek for errors.

If it's not a live server, you may turn on display_errors setting in the php.ini

Sign up to request clarification or add additional context in comments.

1 Comment

I checked my windows/temp/php-errors.log file and this error is not being logged, just some php notices. And I have error reporting set to E_ALL and display errors = 1 in the php file itself(actually an included config file)
0

What do you mean? PHP does detect that problem and does report the error, if you have errors turned on:

Parse error: syntax error, unexpected '<' in ### on line #

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.