OJS 2.4.6.0 to OJS 3.2.1.1 upgrade error

Hi Alec i am trying upgrade from ojs 2.4.6.0 to ojs 3.2.1.1

image , could not succeed!! Below are the errors, kindly help.

PHP Warning: require_once(/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php): failed to open stream: No such file or directory in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25 PHP Fatal error: require_once(): Failed opening required ‘/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php’ (include_path=’.:/usr/share/php’) in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

Hi @suresh_patil,

Do you have something in lib/pkp/plugins/generic/usageStats in your installation?

Regards,
Alec Smecher
Public Knowledge Project Team

No,

my ojs2x installation does not have generic folder inside lib/pkp/plugins

it looks like

image

l

Hi @suresh_patil,

What about the OJS 3.2.1-1 codebase you’re attempting to upgrade to?

Can you turn on the show_stacktrace option in config.inc.php and try again?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

Thank you for your reply!!

Below is what i have in generic folder ojs3x (which i am trying to upgrade to…)

image

i turned on the show_stacktrace option in config.inc.php and tried upgrade command

below are the errors

PHP Warning: require_once(/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php): failed to open stream: No such file or directory in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

PHP Fatal error: require_once(): Failed opening required ‘/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php’ (include_path=’.:/usr/share/php’) in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

Hi @suresh_patil,

Hmm, I was expecting to see a stack trace below the PHP Fatal Error message; do you see anything like that in the log?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Alec,

i am sorry, forgot to paste the stacktrace from error log.

below is what i have in error_log

[Wed Jul 29 06:53:15.086890 2020] [:error] [pid 90986] [client 128.14.133.58:45840] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 07:33:35.733000 2020] [:error] [pid 90988] [client 2.183.126.46:53781] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 07:41:13.458001 2020] [:error] [pid 90989] [client 191.100.10.34:46304] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 08:43:02.893206 2020] [:error] [pid 90989] [client 223.240.104.222:46865] script ‘/var/www/infoopen/public/index.php’ not found or unable to stat

[Wed Jul 29 08:43:03.430310 2020] [:error] [pid 95680] [client 223.240.104.222:46931] script ‘/var/www/infoopen/elrekt.php’ not found or unable to stat

[Wed Jul 29 08:43:03.704383 2020] [:error] [pid 90991] [client 223.240.104.222:46934] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 08:43:04.973812 2020] [:error] [pid 95682] [client 223.240.104.222:47081] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 09:47:32.534892 2020] [:error] [pid 90988] [client 104.244.78.107:57142] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374, referer: http://52.172.212.239:80/left.html

[Wed Jul 29 10:58:25.434940 2020] [:error] [pid 90990] [client 120.151.183.13:51739] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

[Wed Jul 29 11:05:43.291838 2020] [:error] [pid 95680] [client 91.217.79.207:44436] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

Hi @suresh_patil,

I think your PHP installation is too old for OJS 3.2.1-1; see docs/README.md for minimum requirements.

Regards,
Alec Smecher
Public Knowledge Project Team

image

…and as per the system requirements, i am using PHP version is 7.2, should i upgrade??

Hi @suresh_patil,

That confirms that your command-line PHP is 7.2.x, but the message:

[Wed Jul 29 11:05:43.291838 2020] [:error] [pid 95680] [client 91.217.79.207:44436] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

…clearly indicates a PHP version older than 7.1. Maybe your web-based PHP is a different version? You can check this with a phpinfo script; see e.g. https://github.com/laravel/framework/issues/23537#issuecomment-373060279 for instructions.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

yes you are right , my web based PHP was 7.0 version , now i upgraded it to 7.2

tried upgrading now still the same errors persists

PHP Warning: require_once(/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php): failed to open stream: No such file or directory in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

PHP Fatal error: require_once(): Failed opening required ‘/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php’ (include_path=’.:/usr/share/php’) in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

[Thu Jul 30 07:46:07.569458 2020] [:error] [pid 14435] [client 104.244.78.107:40276] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374, referer: http://52.172.212.239:80/left.html
[Thu Jul 30 09:51:59.554634 2020] [:error] [pid 14438] [client 95.132.4.33:58582] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 10:51:21.811628 2020] [:error] [pid 14436] [client 192.241.218.213:51410] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 12:46:03.750321 2020] [:error] [pid 14434] [client 50.202.188.22:4824] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 12:46:07.181126 2020] [:error] [pid 14435] [client 50.202.188.22:25466] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 12:46:11.129808 2020] [:error] [pid 14437] [client 50.202.188.22:25607] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 12:48:36.694114 2020] [:error] [pid 21384] [client 128.14.209.234:48762] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374
[Thu Jul 30 15:53:41.480677 2020] [:error] [pid 14435] [client 158.174.84.5:50729] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374

Hi @suresh_patil,

Do you see any of this error:

 [Thu Jul 30 07:46:07.569458 2020] [:error] [pid 14435] [client 104.244.78.107:40276] PHP Parse error: syntax error, unexpected ‘?’, expecting variable (T_VARIABLE) in /var/www/infoopen/lib/pkp/classes/notification/PKPNotificationOperationManager.inc.php on line 374, referer: http://52.172.212.239:80/left.html

…appearing since the PHP version upgrade? Or are those just old entries?

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

The error messages are same for both PHP 7.0 and PHP 7.2. that means both, before and after upgrade the errors are same.

Hi @suresh_patil,

As long as you’re getting the message:

PHP Parse error: syntax error, unexpected ‘?’,

…something older than PHP 7.1 is trying to run OJS. If you still get that message upon trying to upgrade, you’ll definitely need to resolve it. Unfortunately the details will be system specific so I can’t give any more guidance than that.

The other error I see is this one:

PHP Fatal error: require_once(): Failed opening required ‘/var/www/infoopen/lib/pkp/plugins/generic/usageStats/GeoLocationTool.inc.php’ (include_path=’.:/usr/share/php’) in /var/www/infoopen/lib/pkp/includes/functions.inc.php on line 25

To fix this, try applying this change to your code.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi Mr Genius @asmecher your fix has worked for me!!! i have upgraded the ojs2x to ojs3x… thanks a ton!!!

you might get thousands of questions everyday, i must appreciate for the fact that you will respond each of those with utmost sincerity/passion…kudos to your kinda TRIBE!!!

1 Like

Hi @suresh_patil,

Happy to help and glad it worked :slight_smile:

Regards,
Alec Smecher
Public Knowledge Project Team