I have php version 4.3.9 and i have install privatemsg module on my site. After install module i no have access to site in httpd logs i see:

PHP Notice:  Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /home/www/docs/includes/database.inc on line 213, ...

How i can fix this?
I fond this node - http://drupal.org/node/647328
But in my version i have allready this patch :)

CommentFileSizeAuthor
#3 pm_block_user_php4_compat.patch1.71 KBberdir

Comments

berdir’s picture

Status: Active » Closed (duplicate)

Now, php 4.3.9 is *really* old. I would assume you are using an old enterprise level linux (SLES/RHEL/CentOS) but still, this is old. So if there is any chance, I would urge you to upgrade PHP.

Did you also upgrade Drupal? Since that's very basic code that's not only used in Privatemsg but all over the place.

See #586468-4: Code uses a constant that is not defined in all version of PHP after version 4.3.5 for a possible workaround.

Mascher’s picture

Title: Use of undefined constant PHP_INT_MAX error after install module. » Parse error, unexpected '&', expecting T_VARIABLE in pm_block_user.module on line 511
Status: Closed (duplicate) » Active

What the hug :)
See on drupal System requirements - http://drupal.org/requirements
Required: PHP version 4.3.5 or higher

You have "System requirements" for Privatemsg module?
And other...

Bug with PHP_INT_MAX fixed ( http://drupal.org/node/586468#comment-2250312 ) with next code pasted into the top of database.inc:

<?php

function get_int_max()
{
    $max=0x7fff;
    $probe = 0x7fffffff;
    while ($max == ($probe>>16))
    {
        $max = $probe;
        $probe = ($probe << 16) + 0xffff;
    }
    return $max;
}

if (!defined('PHP_INT_MAX'))
{
    define ('PHP_INT_MAX', get_int_max());
}
define ('PHP_INT_MIN', (int)(PHP_INT_MAX+1));
?>

And... If I fix bug with PHP_INT_MAX error, I have next error in pm_block_user module:

PHP Parse error:  parse error, unexpected '&', expecting T_VARIABLE or '$' in /indx/www
/gamezone2/sites/all/modules/privatemsg/pm_block_user/pm_block_user.module on line 511

What about that? :)

berdir’s picture

StatusFileSize
new1.71 KB

Yeah, I know the Drupal system requirements. And I'm sure you've seen the "(Contributed modules may not support this version of PHP)" :)

Anyway, we *try* to support PHP 4 but I don't have a PHP 4 (nor Mysql 4, for that matter) test environment, so I can't guarantee for it.

Try the attached patch, that should fix the issue but I haven't tested it yet.

Also, this shows how many still use PHP 4. Not so much :)

berdir’s picture

Status: Active » Needs review
Mascher’s picture

Status: Needs review » Closed (fixed)

Patch work ok :)
Thank You!
I test module for full functionality on my system :)

berdir’s picture

Status: Closed (fixed) » Needs review

Don't set this to closed, we want to have this commited and fixed, don't we ? :)

Mascher’s picture

Ok! If i have found bug, i report here :) I Like this module.

berdir’s picture

Version: 6.x-1.1 » 6.x-1.x-dev

Changing the version (needed for testing the patch)

Status: Needs review » Needs work

The last submitted patch, pm_block_user_php4_compat.patch, failed testing.

berdir’s picture

Status: Needs work » Needs review

#3: pm_block_user_php4_compat.patch queued for re-testing.

berdir’s picture

Status: Needs review » Fixed

Commited to branches 6.x-1.x and 6.x-2.x, thanks for reporting and testing!

Status: Fixed » Closed (fixed)

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