Upgrading Open Harvester from PHP 5.2 to PHP 7.1

Hey there,

I’m working on trying to upgrade a website, that is using Open Harvester as its framework, to PHP 7.1. Could I please get some help on doing this please?

Hi @Christa_Wright. Have you looked here and here?

Maybe if you proceed with the upgrade and share any issues you face? that way it will be easier to help.

Hi @Christa_Wright,

The .tar.gz release of OHS is not compatible with PHP7, but the ohs-stable-2_3 branch in github is. If you’re handy with git, you can get it going that way.

Alec Smecher
Public Knowledge Project Team

1 Like

Hi @asmecher,

Following your instructions on the same issue, I used the ohs-stable-2_3 branch, but had to make some small changes to the source code of two of the default plugins (MySqlIndexPlugin and TinyMCEPlugin) to get the site running. Would you want to see a diff or pull request for the changes, or is this is a known issue?


Fischer Jemison

Hi @jemisonf,

It’s entirely possible that I overlooked something – PRs welcome!

Alec Smecher
Public Knowledge Project Team

@asmecher here’s a link to the PR. Please let me know if there are any issues, I’m not super experienced with open source development, PHP development, or harvester development but this seemed pretty straightforward.

Hi @jemisonf,

Merged, thanks! But there will likely be more of this sort – essentially that code was written for PHP4 and since PHP5 and PHP7 came along the language has gotten a lot more picky about what it generates warnings for. If you configure your web server to log errors and warnings, rather than sending them to the browser, they won’t interfere with your work.

Alec Smecher
Public Knowledge Project Team

The ohs-stable-2_3 branch should be working properly with php73 and psql11?
I’m facing this message error when I try install it

A database error has occurred: ERROR: relation "email_templates_default_email_key" already exists

Here is the apache log:

[Wed Dec 30 23:43:30.136513 2020] [php7:notice] [pid 1699:tid 139997047826176] [client XXXX.XXXX.XXXX:46578] harvester2 has produced an error\n  Message: WARNING: Declaration of ADODB2_postgres::_CreateSuffix($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint) should be compatible with ADODB_DataDict::_CreateSuffix($fname, $ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint)\n  In file: /var/www/html/ojs-sbc/ohs/lib/pkp/lib/adodb/datadict/datadict-postgres.inc.php\n  At line: 0\n  Stacktrace: \n  Server info:\n   OS: Linux\n   PHP Version: 7.3.25\n   Apache Version: Apache/2.4.46 (codeit) OpenSSL/1.1.1i PHP/7.3.25\n   DB Driver: postgres, referer: https://nome.dominio.local/ohs/index.php/install
XXXX.XXXX.XXXX - - [30/Dec/2020:23:43:30 -0300] "POST /ohs/index.php/install/install HTTP/1.1" 200 16309 "https://nome.dominio.local/ohs/index.php/install" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:84.0) Gecko/20100101 Firefox/84.0"

Thiis topic is realy old :pensive:
Should I open a new one?