Page 1 of 1

PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 9:25 am
by Phoenixheart
Ok, here is my headache: I have a script to upload a csv file, parse it, and validate the email address in each record (line) using exect("dig") or getmxrr(). Everything works well with small files, but once I use a big file (with > 100,000s of records), a weird problem occurs:

- If I turn off error reporting, the whole page goes blank after a long execution time. No error, no notices, no message, nothing.
- If I set error reporting to E_ALL AND there's some notices/errors during the progress, the result appears correctly (though among a chaos of error reporting lines).

Is this something related to memory? I ini_set()'ed max_execution_time and max_input_time to 3600, and memory_limit to 128M.
Ah, by the way it's a Lunarpages host.

:banghead: :banghead:

Could anyone please help? Thanks very much in advance.

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 9:53 am
by ghurtado
With a large uploaded file, you could be running out of memory before ini_set is even called. Can you change it in PHP.ini?

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 10:34 am
by pawarnilesh4u
As your file is very large it must be running out of memory while uploading and parsing the same, also please check for the max execution time. It must be the issue with max execution time. try executing the script in background.

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 10:36 am
by Phoenixheart
Hi, I understand that php code is only called _after_ the upload, so the settings are done in php.ini and even Apache htaccess.
But as I said, it works when there are some errors displayed, so upload limit is not a problem.

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 10:43 am
by Phoenixheart
pawarnilesh4u wrote:As your file is very large it must be running out of memory while uploading and parsing the same, also please check for the max execution time. It must be the issue with max execution time. try executing the script in background.
Thank you, but as I said, the "switch" between working and non-working is the errors displayed. :banghead: :banghead:

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 10:45 am
by ghurtado
Where are those errors?

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 10:54 am
by Phoenixheart
Like, in my code there is a place when I attempt to refer to an undefined variable. A notice will be displayed.
But strange enough, calling trigger_error() for a user-defined error message doesn't help the page from displaying blank. Only php native errors will do.

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 11:58 am
by ghurtado
What I meant by "Where are those errors?" was "Please paste the errors here so that we may read them and thus better help you" :)

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 12:53 pm
by Phoenixheart
The errors were ANY PHP error/notice messages. For an example, I intentionally call $my_array[0] when the array has no element. A notice will be displayed, and then the result is shown.

If I do error_reporting(0), no error messages will be output, and so will the result.

Re: PHP Blank Page - weird...

Posted: Thu Aug 21, 2008 1:08 pm
by ghurtado
As you wish.

You have shown no source code and no error messages, I doubt anyone here will be able to help you much.