PHP Parse error: syntax error, unexpected '?' in /lib/pkp/lib/vendor/illuminate/support/Str.php on line 681

Dear Sir,

I migrated my OJS 3.1.2-1 journal to another server with same domain. After migration I got below error PHP Parse error: syntax error, unexpected ‘?’ in /lib/pkp/lib/vendor/illuminate/support/Str.php on line 681

in Archives Page and Submission Page after Login

I tried every possible solution including PHP version 5.6 7 7.1 and 7.2.
I also clear cache after every php version change but not solved.
Please help

Hi @apacetech,

You are having syntax error on null coalescing operator, which was added in PHP 7.0. Please recheck PHP version that you are using, .e.g., by administration -> system information

Dear Vitaliy: I have the same error that started this issue. I read this post and get the PHP 7.0.33 version, but it did not work (when I go to my dashboard, submissions or archives I get the 500 error.

In my error log appears:

[26-Jul-2023 00:57:53 UTC] PHP Warning: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home/…/public_html/revistasojs/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134

[26-Jul-2023 00:57:53 UTC] PHP Parse error: syntax error, unexpected ‘}’, expecting ‘;’ in /home/…/public_html/revistasojs/lib/pkp/lib/vendor/illuminate/support/Str.php on line 682

[26-Jul-2023 00:57:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADODB_Cache_File has a deprecated constructor in /home/…/public_html/revistasojs/lib/pkp/lib/adodb/adodb.inc.php on line 263

[26-Jul-2023 00:57:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADOConnection has a deprecated constructor in /home/…/public_html/revistasojs/lib/pkp/lib/adodb/adodb.inc.php on line 359

[26-Jul-2023 00:57:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet has a deprecated constructor in /home/…/public_html/revistasojs/lib/pkp/lib/adodb/adodb.inc.php on line 2921

[26-Jul-2023 00:57:55 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet_array has a deprecated constructor in /home/…/public_html/revistasojs/lib/pkp/lib/adodb/adodb.inc.php on line 3939

[26-Jul-2023 00:57:55 UTC] PHP Warning: Declaration of CustomBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home/…/public_html/revistasojs/plugins/generic/customBlockManager/CustomBlockPlugin.inc.php on line 134

We are using OJS 3.1

Plataforma SO Linux

Versión PHP 7.0.33

Versión Apache Apache

Driver de la base de datos mysqli

Versión del servidor de bases de datos 5.6.51

(I know the OJS version it’s old, we are planning an update in the next months, but at this moment we need to publish an issue and we get this error).

Thank you in advanced

@Jvil, I see you’ve also posted this as a new topic. I’ll close this thread in favour of that one. In general, it’s best to post a question just once in the place you think best – otherwise it might duplicate support effort.

Regards,
Alec Smecher
Public Knowledge Project Team