When running update.php I get error messages like:


An error occurred. http://www.mysite.com/update.php?id=30&op=do { "status": true, "percentage": 27, "message": "Remaining 16 of 22.\x3cbr/\x3eUpdating nodewords module" }<br /> <b>Notice</b>: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in <b>/var/www/mysite/drupal-6.14/includes/database.inc</b> on line <b>213</b><br /> <br /> <b>Notice</b>: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in <b>/var/www/mysite/drupal-6.14/includes/database.inc</b> on line <b>213</b><br /> <br /> <b>Notice</b>: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in <b>/var/www/mysite/drupal-6.14/includes/database.inc</b> on line <b>213</b><br />

and also

Notice: Use of undefined constant PHP_INT_MAX - assumed 'PHP_INT_MAX' in /var/www/mysite/drupal-6.14/includes/database.inc on line 213

I assume it has to do with the PHP version, which is still 4.3.9 as I am running CentOS 4.8 ie Red Hat Enterprise Linux 4.8. Like everyone on this release, I am stuck with this PHP version unless going to some elaborate measures to update PHP, which may cause new issues. As far as I know it requires at least PHP 4.4.0 for PHP_INT_MAX.

Since the core of Drupal 6.14 is still running fine on PHP 4.3.9, it would be "great" to have Drupal 6.x contributed modules to be not more demanding.

Not surprising, the same happens when updating nodewords to version 6.x-1.2

Comments

avpaderno’s picture

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

The code doesn't make any references to that constant.
I will test the module on PHP4, but for what I can see, it could be a problem caused by another module.

avpaderno’s picture

Category: bug » support
Status: Active » Fixed

See the following code, which is found in database.inc:

      if ($value > PHP_INT_MAX) {
        $precision = ini_get('precision');
        @ini_set('precision', 16);
        $value = sprintf('%.0f', $value);
        @ini_set('precision', $precision);
      }

I am not sure of the requirements of Drupal 6, but if it is reported to work also with versions of PHP before 4.4 then it is a bug of Drupal.

avpaderno’s picture

The requirements for Drupal reports that PHP version 4.3.5 is required. As you are using version 4.3.9, I would expect that Drupal should work with your PHP version as well.

avpaderno’s picture

I opened a bug report for that (see #586468: Code uses a constant that is not defined in all version of PHP after version 4.3.5). If it is not a problem with PHP included with CentOS (which could be not correctly implemented), then it must be a problem with Drupal 6.14. At least it should be documented that in some operating system the PHP version to use must be different from the one reported in the Drupal requirements page.

hd’s picture

Thanks for bringing this to the right place.

Status: Fixed » Closed (fixed)

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