Jump to content

Blank Page Woes...


htzone

Recommended Posts

So, I'm getting a blank PHP page and it's driving me nuts. Unfortunately the client won't let me post my code up here, but rest assured that I'm an experienced web developer and have checked all of the usual suspects.

 

I enabled error reporting, checked my apache error log, and neither of those produce any messages. The syntax is correct. I tossed in "die('here!')" in a few places until I couldn't see it. I narrowed down the stop point as being somewhere in the middle of a foreach loop. Before this foreach loop, I'm using array_merge on some fairly large pieces of data, but nothing unreasonable. When I comment out the array_merge line, the page works correctly. I figured maybe there was some kind of memory issue, or execution timeout thing going on, but when I increase both of those settings it has no effect.

 

In essence, I'm wondering what might be some causes of the blank page problem beyond the common ones, since I'm really scratching my head over this one.

Link to comment
Share on other sites

What version of PHP are you using ?

 

http://php.net/manual/en/function.array-merge.php

 

Warning

 

The behavior of array_merge() was modified in PHP 5. Unlike PHP 4, array_merge() now only accepts parameters of type array. However, you can use typecasting to merge other types. See the example below for details.

 

Make sure both parameters are array, else type cast them to be on the safe side.

Link to comment
Share on other sites

In general, you should only set error_reporting/display_errors/log_errors globally, either in your master php.ini (when you have access to it, such as on your development system), in a local php.ini (when php is running as a CGI), or in a .htaccess file (when php is running as an Apache module.)

 

Setting them to OFF in your code generally means you hiding errors rather than fixing them and it will come back and bite you at some point in time.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.