0

I am working on a PHP script locally that has a bug in it somewhere.

I am developing locally using the latest version of XAMPP. Whenever the script causes an error I simply get a white blank page.

Is there a way I can get the error printed to the screen?

I have checked Apache and PHP and as far as I can see I have error reporting enabled.

When I receive the white error screen nothing is logged to the Apache or PHP log files.

Makes it very frustrating trying to debug the script.

Would it be a browser thing? I am using FireFox.

Any tips would be greatly appreciated.

Thanks

Jason
  • 4,899
  • 12
  • 47
  • 56

1 Answers1

1

This sounds like a syntax error (e.g. missing a closing bracket). Put a print statement at the beginning of the script and make sure it's actually running. If it's not, go hunting for a syntax error.

Add something simple to inform you if the script is being executed like print("Starting script example.php");

You can also add this to your php.ini file to make sure that error reporting is on: error_reporting = E_ALL

Ryan Fisher
  • 1,485
  • 1
  • 19
  • 32
  • Thanks Ryan, I will try that. So this type of error wouldn't be printed to the screen? – Jason Oct 06 '12 at 01:44
  • I have the error_reporting = E_ALL set in the php.ini file. It's WordPress so it makes it harder. I also WP_DEBUG set to true. – Jason Oct 06 '12 at 01:51
  • If error reporting is on you should get output regarding a syntax error. Without seeing code it's difficult to know what is causing the page content to not be generated. This questions has more information on php error reporting: [How to get useful error messages in PHP?](http://stackoverflow.com/questions/845021/how-to-get-useful-error-messages-in-php) – Ryan Fisher Oct 06 '12 at 02:08
  • Thanks Ryan. I much appreciate your input. I got the site working again. It had to do with the WordPress Importer. Don't know what the error was, however am not using that file anymore. – Jason Oct 06 '12 at 02:14