Can OCS work with PHP7.0?

We have a new web server, and I’m trying to move our OCS 2.3.6 installation to it. The web page does not come up, and a message in the Apache error log says,

“PHP Fatal error: Cannot use ‘String’ as class name as it is reserved in /opt/www/conferences-test.uta.edu/lib/pkp/classes/core/String.inc.php on line 57”

This seems to be common to problems with PHP7.0 and software designed for older PHP versions. Is there any way to make OCS work on the new server? The server runs Ubuntu 16.04 and Apache 2.4. as well as PHP7.0.

OCS will require refactoring for PHP7 support similar to what was required for OJS and OMP. See this issue:

OCS 2.3.x will not work with PHP7.

Hi all,

We haven’t decided our plans for OCS yet. Once PHP 7.0 hits a reasonable deployment threshold we may assess minor changes to permit it to run on that platform, but haven’t done so yet.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi has this issue been resolved, please? PHP 7.2 is widely used now and we are planning change our hosting server which provides only PHP 7.2 on Debian 9

Hi @Dilan_Rostam,

The ocs-stable-2_3_6 git branch of OCS has been updated to work with PHP7.x; I’m not sure yet whether we’ll build a formal release, but you should be able to update to that branch without e.g. database changes or anything. (Just make sure you update from that branch both in the ocs repo and lib/pkp submodule.)

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you, This is too technical for us. Is there any instruction around please?

If you have any experience with git, you should be able to create a deployment via:

git clone https://github.com/pkp/ocs
cd ocs
git checkout ocs-stable-2_3_6
git submodule update --init --recursive

You could then use the files in the “ocs” directory as your install package, as with any other upgrade.

Without using git, you will be dependent on waiting for a formal release.

The Plesk 17 allow for adding extension Git which then pull auto any update and deploy that to the installation. I did this and it did not help :frowning:

I have now deployed this to the subdomain, and the nature of error log is changed, but I am not sure what it means,

Hi @Dilan_Rostam,

Something is referring to SubmissionSearch, but I don’t see any reference to it in the OCS codebase on the ocs-stable-2_3_6 branch. You can search for references by running e.g.:

 find /path/to/ocs -type f -exec fgrep SubmissionSearch "{}" ";"

…replacing /path/to/ocs with your OCS installation directory.

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry my fault I have uploaded error message for the other treat I have on OJS, here is the error message I get after I have deployed the Git ,

ocs_git_update_error_log

Hi @Dilan_Rostam,

I still think your codebase isn’t properly updated with the latest code in the right branch or there is some old code hanging around. The latest ocs-stable-2_3_6 code doesn’t contain any references to PKPRole. As a start, I’d suggest flushing your template cache by removing all files from cache/t_compile. That may help.

Regards,
Alec Smecher
Public Knowledge Project Team

I cleared the cache of all files and pulled the GIT again and the error messages is the same :frowning:

This is my Git setting
ocs_git_update_setting

and This is error message I got after the new action

ocs_git_update_error_log2

Hi @Dilan_Rostam,

I think the lib/pkp submodule is on a different branch than the OCS repository.

Regards,
Alec Smecher
Public Knowledge Project Team

I am not sure what it means but the file error refer to is where it should be please see

ocs_git_update_error_log3

Hi @Dilan_Rostam,

It means you’ve checked out the OCS code from github in an incorrect/inconsistent way. The instructions @ctgraham send you above should do it correctly.

Regards,
Alec Smecher
Public Knowledge Project Team

I did that setting for Git module in Plesk to pull the update. Is that setting wrong?

Hi @Dilan_Rostam,

I’ve never used the Plesk git module, so I can’t help with that – but if you’re seeing warnings/errors relating to PKPRole, then there is definitely some incompatible code mixed in with your installation. The ocs-stable-2_3_6 branch contains no references to PKPRole in it.

Your question is more about git and branches than it is about OCS, so you might try looking at some documentation on those in particular.

Regards,
Alec Smecher
Public Knowledge Project Team

It is an easy module and here is a clear video how it works,

Is the Git deployment supposed to replace all files in my OCS directory? If so I can remove all the files and just Git to replace them.

Is it the Master Branch that needs to be pulled? The Git says
Branch: master; Automatic deploy to conferences.koyauniversity.org

and reports Last Commit info:
commit 2712144f1543366d13b100f953c0176cad6fdb97
Merge: edd6413c7 76415209b
Author: Alec Smecher alec@smecher.bc.ca
Date: Wed Aug 29 16:08:14 2018 -0700

Merge pull request #44 from kant/patch-1

Update Forum URL

ocs_git_update_error_log4

I managed to get this work, The git kept bringing the Master copy. So I got the direct Git link from github.com for the OCS 2.3.6 which is here and it worked

Git

It is now working :slight_smile: Thank you