I am getting a blank page for a script that pulls a large number of records from the database. I’m 99% sure the problem is not enough memory - if I increase the memory_limit then the page will work.
However, I don’t know why no error is being printed and I am getting a blank page when the memory_limit is set at default. The page is just loading up blank straight away, it is not taking any time before loading up blank.
In my php.ini I have:
log_errors = off
;error_log = /home/djeyewater/logs/php-errors.log
display_errors = on
display_startup_errors = on
...
error_reporting = E_STRICT|E_ALL
In my server config I have
fastcgi_intercept_errors on;
So fatal PHP exceptions are normally output to the server logs, and other errors to the screen.
Depending on the LIMIT I set in the query, for a smaller number of records I get a 501 error in the browser and the following in the server log:
2011/11/05 14:26:58 [error] 980#0: *182 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 127.0.0.1, server: www.photosite.com, request: "GET /generate-dummy-records.xhtml HTTP/1.0", upstream: "fastcgi://unix:/home/djeyewater/apps/php/var/run/php.sock:", host: "www.photosite.com"
For a larger LIMIT (or no LIMIT) I get a blank page and no error in the server log.
The page itself is below:
<?php
echo 'Hello';
include('globalFuncs.inc.php');
$imageData = array();
$result = $conn->query('SELECT * FROM imageData LIMIT 5000');
while($row = $result->fetch_assoc()){
$imageData[] = $row;
}
$result->close();
if($conn->errno){
echo $conn->error;
}
I have also tried adding
ini_set('display_errors',1);
error_reporting(E_ALL);
to the top of the script, but this didn’t make any difference.
Does anyone know why I’m not seeing an out of memory error but just getting a blank page instead?
My PHP version is 5.3.4.
Thanks
Dave