I was trying to upgrade from OJS 3.3.0.15 to 3.3.0.17 following instructions on https://docs.pkp.sfu.ca/dev/upgrade-guide/en/, but when I run the command php tools/upgrade.php check
, I get the error
PHP Fatal error: Uncaught Error: Call to undefined function putenv() in /var/www/revista/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php:292
Stack trace:
#0 /var/www/revista/ojs/lib/pkp/classes/cliTool/CliTool.inc.php(64): PKPLocale::initialize()
#1 /var/www/revista/ojs/lib/pkp/classes/cliTool/UpgradeTool.inc.php(36): CommandLineTool->__construct()
#2 /var/www/revista/ojs/tools/upgrade.php(21): UpgradeTool->__construct()
#3 {main}
thrown in /var/www/revista/ojs/lib/pkp/classes/i18n/PKPLocale.inc.php on line 292
Itâs installed and running in an Ubuntu 22.04 webserver (Apache 2.4, MySQL 8.0, PHP 8.0), in Brazilian Portuguese (pt_BR) language (pt_PT and es_ES languages also installed on OJS). I tried changing the language to English before the upgrade, but got the same error.
I tried this same upgrade before, in a sandbox server âalmostâ like this one (same Ubuntu, Apache, MySQL and PHP versions), with the same languages installed on OJS (and running in pt_BR), and it worked just fine.
The main differences between the OJS in the sandbox server and the one on the production server (where the upgrade failed) is that on the productionâs OJS salt, smtp, and recaptcha are enabled and configured (and working). I disabled them and tried to upgrade, but got the same error.
The PHP on the production server has more modules enabled and configured than the sandbox (apcu, imagick, memcached, redis, JIT and opcache).
Other difference is that the production server has much more users and content on OJS.
(Note: I tried to run php tools/upgrade.php check
on the current version of OJS (3.3.0.15), and got the same error).