While running some PHP code on my private WAMP PC I'm suddenly getting a blank response from the server - no response actually. No headers, no data, nothing in the PHP error logs, nada. I restarted APACHE and PHP but still nothing. I know php is working because I can access other PHP scripts just fine.
Firebug reports no headers, ? bytes, and it only takes 163ms to "load" (so it's not a timeout). I thought about rapid memory consumption - but I monitored my PC's memory and it's not showing any spikes. Errors and Exceptions have been working fine until now.
What in the world?
max_execution_time = 30 ;
max_input_time = 60 ;
max_input_nesting_level = 64 ;
memory_limit = 500M ;
error_reporting = E_ALL | E_NOTICE | E_STRICT
display_errors = On
log_errors = On
:EDIT:
I wouldn't touch @
with a ten-foot-pole. I think the ruby guys throw that in there so programmers would drop PHP.
Anyway, I enabled xdebug and it didn't output any grind files. Then I took zombat's advice and placed a DIE() at the top of the page and it worked. I guess that I just have some very weird code that totally kills PHP. Even if errors were disabled or suppressed with @
I should still be getting back a header from the server with the empty content!
If I find more I'll post back.
Run the page from a console and you'll get the error message.
// nix
php yourFile.php
// Windows
c:\path\to\php.exe yourFile.php
You could have a .htaccess file in this directory which has modified error reporting.
To test, try explicitly setting these options at the top of your php script which is giving you trouble.
ini_set('display_errors',1);
error_reporting(E_ALL);
I've also seen this caused by over-zealous anti-virus packages. Some contain web proxy software to filter internet and email. In that case, the page would just continue load into infinity but never complete.
Beware the @ (error suppression) operator, if you have a syntax error on a line with @ PHP will silently exit.
To detect this condition, use set_error_handler and write your own error handler, you'll still get called for errors where @ is used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With