Blank page after enable module

Don 944 LA - September 5, 2007 - 17:36
Project:BitTorrent
Version:5.x-1.x-dev
Component:Miscellaneous
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Everytime I try to use this, I get the same thing, a blank page after enableing the module.
At first I thought that it was because I missed the install notes to copy announce,scrape etc .. into the root dir. however, I later did that on a freash install and still no luck.

I have tried this on :
Drupal 5.2
Drupal 5.1
VB-Drupal 5.2

Is there something special I need to enable on the server ???
I am using a VPS (virtual private server) with root access etc ... using a Plesk CP manager.

in my .htaccess file, I have also added this:
php_value max_execution_time 300
php_value max_input_time 300
php_value upload_max_filesize 601M
php_value post_max_size 30M
php_value memory_limit 30M

oh, and "/files" is chmod 777 recursive

please advise.
If I can at least get this going, I will test it like crazy, however, I don't know where to start
I would list a url, but it would just give a blank screen

thanks again.

#1

VM - September 5, 2007 - 17:45

when you added those lines to .htaccess did you do a phpinfo() to insure the memory was indeed changing ?

have you tried using a custom php.ini file in your drupal root to change the memory ?

have you asked your host to increase the memory ?

#2

VM - September 5, 2007 - 17:48

ignore the "have you asked your host?" part. Now that I reread and see you are on a VPS

#3

VM - September 5, 2007 - 17:52

follow up:

another thing to check which may be telling, is your apache error logs, which should be stored on your VPS somewhere and should have an exact error message for the blank page.

#4

bradfordcp - September 5, 2007 - 18:28

I agree with VeryMisunderstood a couple lines from the log would get the ball rolling as far as figuring out exactly what is wrong. Also are you using the beta or development snapshot release?

#5

grafik - January 18, 2008 - 11:46

I have the same problem,
Drupal 5.6, bittorrent bittorrent-5.x-1.x-dev or bittorrent-5.x-1.0-beta
In apache error log is:
[client 85.xxx.xx.x] PHP Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /var/www/domain/httpdocs/bt_common.inc on line 275, referer: https://domain/?q=admin/build/modules

#6

grafik - January 18, 2008 - 11:55

Solution:
bt_common.inc:

275: foreach($bparsed as $key => &$value) {
...
275: foreach($bparsed as $key => $value) {

#7

Jonas Kvarnstrom - January 18, 2008 - 11:56

"Unexpected '&'" provides a clue. In my version, line 275 is a comment, but line 287 says:

<?php
   
foreach($bparsed as $key => &$value) {
?>

According to http://se.php.net/foreach, the ability to use a reference (&) in foreach was added in PHP 5, which means anyone using PHP 4 should get a syntax error at that point.

It should be possible to rewrite the function to something like the following (untested, and I'm not a PHP expert, so it may well crash or behave badly):

<?php
function strip_excess($bparsed) {
  if (
is_array($bparsed)) {
    foreach(
$bparsed as $key => $value) {
      if (
is_array($value)) {
        if (
array_key_exists('value', $value)) {
         
$bparsed[$key] = strip_excess($value['value']);
        }
        else {
         
$bparsed[$key] = strip_excess($value);
        }
      }
    }
  }
 
  if (
is_array($bparsed) && array_key_exists('value', $bparsed)) {
    return
$bparsed['value'];
  }
  else {
    return
$bparsed;
  }
}
?>

#8

Jonas Kvarnstrom - January 18, 2008 - 11:59

#6, I doubt just removing the "&" is sufficient. Doesn't that mean that you only operate on a copy of $bparsed instead of having a real reference? In that case the entire foreach loop should have no effect on $bparsed; you just change the local $value variable instead. It should be necessary to set $bparsed[$key] to the stripped value. (Not that I have any idea what stripping really does...)

#9

bradfordcp - February 4, 2008 - 17:55

When the parser returns the decoded data there is a lot of extra information returned with it. Key information such as the data type and the length of the data. The stripping process removes the excess information leaving only the torrent information.

The output of bdecode() looks like:

*    array(
*      ['type'] => type,              // This can be integer, string, list, dictionary
*      ['value'] => value,            // This is the decoded value
*      ['strlen'] => strlen,          // This is the length of the bencoded string
*      ['string'] => bstring,         // This is the bencoded string
*    )

Stripping converts this from an array into the value (or if the value is an array, into an array of values).

On a side note I will look at cleaning up the foreach loop so that it may run in a PHP 4 environment.

#10

bradfordcp - February 4, 2008 - 22:18
Status:active» closed

Fixed the issue with the foreach loop, please report any other errors if you are running on PHP 4

#11

bradfordcp - February 4, 2008 - 22:21
Status:closed» fixed

#12

Anonymous (not verified) - February 18, 2008 - 22:22
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.