PHP Blank Page - weird...

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

PHP Blank Page - weird...

Post 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.
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: PHP Blank Page - weird...

Post 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?
pawarnilesh4u
Forum Newbie
Posts: 6
Joined: Thu Aug 21, 2008 10:16 am
Location: Mumbai - India

Re: PHP Blank Page - weird...

Post 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.
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: PHP Blank Page - weird...

Post 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.
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: PHP Blank Page - weird...

Post 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:
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: PHP Blank Page - weird...

Post by ghurtado »

Where are those errors?
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: PHP Blank Page - weird...

Post 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.
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: PHP Blank Page - weird...

Post 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" :)
Phoenixheart
Forum Contributor
Posts: 123
Joined: Tue Nov 16, 2004 7:46 am
Contact:

Re: PHP Blank Page - weird...

Post 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.
User avatar
ghurtado
Forum Contributor
Posts: 334
Joined: Wed Jul 23, 2008 12:19 pm

Re: PHP Blank Page - weird...

Post 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.
Post Reply