Upgrade failure

I am trying to upgrade from 3.1.2-1 to 3.2.1-1. When I run the upgrade process, I’m getting the following error:

PHP Parse error: syntax error, unexpected ‘.’, expecting ‘&’ or variable (T_VARIABLE) in …/ojs-3.2.1-1/lib/pkp/lib/vendor/illuminate/support/helpers.php on line 1141

This seems odd to me, because line 1141 in helper.php is a function declaration. Was there a php version requirement change between last year (when I upgraded to 3.1.2-1). I see that the server where this is running has PHP version 5.4.45.

Hi @wklyons,

The PHP requirements for each version are in docs/README.md or docs/README. For OJS 3.2.1-1, it’s PHP 7.2; for OJS 3.1.2-1 it was PHP 7.0. PHP 5.4.45 is extremely obsolete and should definitely be updated!

Regards,
Alec Smecher
Public Knowledge Project Team

I updated the php level to 7.0 in the 3.1.2-1 site (before trying the update again) to make sure everything would be find. Now I’m getting a white screen saying that “Database connection failed!”. Looking in the error_log, the most recent entry is: [13-Jul-2020 10:51:43 America/Chicago] ojs2: Database connection failed! I ssh’ed into the server and manually logged into mysql, using the credentials in the config.inc.php file, and selected the named database from that file as well, which worked fine

As a more complete representation of the errors I’m seeing, here is the set of 5 that get generated whenever someone tries to hit the site:

[13-Jul-2020 11:15:21 America/Chicago] 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 …/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 263
[13-Jul-2020 11:15:21 America/Chicago] 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 …/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 359
[13-Jul-2020 11:15:21 America/Chicago] 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 …/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 2921
[13-Jul-2020 11:15:21 America/Chicago] 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 …/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 3939
[13-Jul-2020 11:15:21 America/Chicago] ojs2: Database connection failed!

By the way, the site is down currently, so to me, this is urgent!

Hi @wklyons,

Those warnings are cosmetic; check further back in the log for something containing the word “Error”.

Regards,
Alec Smecher
Public Knowledge Project Team

Looking up from those lines, I can see these two Fatal Errors:

[13-Jul-2020 10:50:52 America/Chicago] PHP Fatal error: Uncaught Error: Call to undefined function mysqli_real_escape_string() in …/public_html/lib/pkp/lib/adodb/drivers/adodb-mysqli.inc.php:227
Stack trace:
#0 …/public_html/lib/pkp/lib/adodb/adodb.inc.php(1010): ADODB_mysqli->qstr(‘currents’)
#1 …/public_html/lib/pkp/classes/db/DAO.inc.php(100): ADOConnection->Execute(‘SELECT * FROM j…’, Array)
#2 …/public_html/lib/pkp/classes/context/ContextDAO.inc.php(143): DAO->retrieve(‘SELECT * FROM j…’, ‘currents’)
#3 …/public_html/lib/pkp/classes/core/PKPRouter.inc.php(251): ContextDAO->getByPath(‘currents’)
#4 …/public_html/lib/pkp/classes/core/PKPRequest.inc.php(859): PKPRouter->getContext(Object(Request), 1)
#5 …/public_html/classes/core/Request.inc.php(69): PKPRequest->_delegateToRouter(‘getContext’, 1)
#6 …/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php(103): Request->getContext()
#7 …/public_html/classes/template/TemplateM in …/public_html/lib/pkp/lib/adodb/drivers/adodb-mysqli.inc.php on line 227
[13-Jul-2020 10:51:05 America/Chicago] PHP Fatal error: Uncaught Error: Call to undefined function json_encode() in …/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php:691
Stack trace:
#0 …/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php(155): PKPTemplateManager->registerJSLibraryData()
#1 …/public_html/classes/template/TemplateManager.inc.php(28): PKPTemplateManager->initialize(Object(Request))
#2 …/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php(884): TemplateManager->initialize(Object(Request))
#3 …/public_html/lib/pkp/classes/plugins/Plugin.inc.php(352): PKPTemplateManager::getManager()
#4 …/public_html/lib/pkp/classes/plugins/Plugin.inc.php(118): Plugin->_registerTemplateResource()
#5 …/public_html/lib/pkp/classes/plugins/LazyLoadPlugin.inc.php(28): Plugin->register(‘generic’, ‘plugins/generic…’, NULL)
#6 …/public_html/plugins/generic/pdfJsViewer/PdfJsViewerPlugin.inc.php(22): LazyLoadPlugin->register( in …/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 691

Could I be missing some extensions?

Hi @wklyons,

Yes, it sounds like you’re missing the mysqli PHP extension.

Regards,
Alec Smecher
Public Knowledge Project Team

This doesn’t seem possible, because I’ve been running 3.1.2-1 for the past year or so. And I know the config.inc.php file specifies mysqli

this turned out to be an .htaccess issue. I’ll be working to get the 3.2.1-1 working. I’ll let you know if there are any issues there.