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.

Comments

vm’s picture

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 ?

vm’s picture

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

vm’s picture

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.

bradfordcp’s picture

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?

grafik’s picture

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

grafik’s picture

Solution:
bt_common.inc:

275: foreach($bparsed as $key => &$value) {
...
275: foreach($bparsed as $key => $value) {
Jonas Kvarnstrom’s picture

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

    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):

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;
  }
}
Jonas Kvarnstrom’s picture

#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...)

bradfordcp’s picture

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.

bradfordcp’s picture

Status: Active » Closed (fixed)

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

bradfordcp’s picture

Status: Closed (fixed) » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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