Whenever I activate my module (by 'activate' I mean tick the module's checkbox on the modules page), I get a white screen.

The white screen goes after I refresh the page.

This happens every time a new page is called.

In an effort to trace the error I have pared back my module to the following:

<?php
function ienergy_form_alter(&$form, $form_state, $form_id){
        switch(
$form_id){
                case
'action_log_node_form':
                       
$form=Array();
                       
$form['#attributes'] = array('enctype' => "multipart/fo$
                       
$form['#submit']['al_ienergy_form_submit'] = array();
                break;
                case 'knoledgebase_node_form':
                       
$form=Array();
                       
$form['#attributes'] = array('enctype' => "multipart/fo$
                       
$form['#submit']['ienergy_form_submit'] = array();
                break;
        }
        return
$form;
}

function
ienergy_form_validate($form, &$form_state) {
}


function
al_ienergy_form_submit($form, &$form_state) {
        global
$user;
}
?>

(the trailing '?>' is omitted, only included here for formatting purposes.)

My /et/php5/apache2/php.ini file has the following
memory_limit = 256M

Comments

Jaypan’s picture

You may want to start by fixing this: $form['#attributes'] = array('enctype' => "multipart/fo$

davecoventry’s picture

<?php
function ienergy_form_alter(&$form, $form_state, $form_id){
        switch(
$form_id){
                case
'action_log_node_form':
                       
$form=Array();
                       
$form['#attributes'] = array('enctype' => "multipart/form-data");
                       
$form['#submit']['al_ienergy_form_submit'] = array();
                break;
                case
'knoledgebase_node_form':
                       
$form=Array();
                       
$form['#attributes'] = array('enctype' => "multipart/form-data");
                       
$form['#submit']['ienergy_form_submit'] = array();
                break;
        }
        return
$form;
}
?>

Sorry, copied and pasted from a Putty session which truncated the actual lines.

The full lines are above.

eelkeboezeman’s picture

what do server logs say? last time i got a WSoD, no errors were logged in Drupal itself, but the server logs showed the PHP errors that occured

davecoventry’s picture

Can't see much to get exited about there:

tail /var/log/apache2/access.log
41.27.2.175 - - [07/Dec/2009:12:57:25 +0200] "GET /inenergy/sites/default/files/logo.jpg HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:25 +0200] "GET /inenergy/themes/sky/images/bg-shade-light.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/themes/sky/images/icn-arrow-down-light.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/themes/sky/images/sprites-sky.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/themes/sky/images/bg-shade-white-lrg.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/misc/powered-blue-80x15.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/sites/all/modules/admin_menu/images/bkg.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:26 +0200] "GET /inenergy/sites/default/files/favicon.ico HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:27 +0200] "GET /inenergy/sites/all/modules/admin_menu/images/icon_users.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"
41.27.2.175 - - [07/Dec/2009:12:57:27 +0200] "GET /inenergy/themes/sky/images/icn-arrow-right-light.png HTTP/1.1" 304 - "http://inenergy.dvrdns.org/inenergy/?q=node/add" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.33 Safari/532.0"

eelkeboezeman’s picture

this is the access log, indeed not very interesting :)
what about you error.log? I am sorry, for I am not very experienced with these kind of things, but the error log should contain PHP errors and other errors logged by apache

tsimpson’s picture

Though my module development experience is also limited, pretty much EVERY white screen I've run into can be fixed by typing:

tail /var/log/http/

... and then hunt up the last log message. It will have the line on which the php engine errored out. 9 times out of 10, if you just go to that line in your code you'll spot whatever it is right off.

eelkeboezeman’s picture

@dave
since you won't get any error feedback from drupal, the only way to find out what is wrong is to locate this log and check for errors

eelkeboezeman’s picture

and why do you return $form if you pass it by reference as well?

davecoventry’s picture

I dunno! I guess I've always done it like that.

Jaypan’s picture

Is this error happening on the modules page, or on the page that the module creates that you are trying to access?

davecoventry’s picture

Hi Jay,

It happens on all new page requests after activation of the module. If the module is deactivated, it returns to normal.

When the white screen appears, it needs a page refresh to get rid of it.

I'm completely perplexed.

dhon’s picture

i have the same problem...when i enabled the modules i have uploaded and press the save configurations button, it gives me a whitescreen...i changed the memory limit of my apache to 32MB and in settings.php in sites/default folder but still nothing happens...anyone have the solution pls share

Jaypan’s picture

32mb may not be enough. I've had to put it as high as 128 before.

dhon’s picture

i tried 128mb but still i got whitescreen..i uploaded cck and firebug for drupal module but when i click the administer link it gives me whitescreen..

Jaypan’s picture

You get it when you click on any admin link, or the admin links for those modules?

dhon’s picture

i got white screen when i click the admin link...by the way are there any issues regarding OS??? cause im running my wamp server in Vista

Jaypan’s picture

What is the URL of the link you are clicking (just the part after the domain name).

Are you clicking /url? Or something else?

dhon’s picture

im clicking the admin link with this address http:/localhost/drupal/admin that page starts the whitescreen

Jaypan’s picture

Sorry, I can't help on this one.

davecoventry’s picture

Min is running on a Debian Linux server.

Could it be something to do with DOS line endings?