Installation errors for OJS 3.0.2

I see the following errors at initial page load at the beginning of the installation process for OJS 3.0.2.

The error is because I have the open_basedir restriction in effect and it is looking at the root of disk instead of looking inside the webroot where the files actually are located. So I’m thinking there is just an error in the path and that it shouldn’t start with a leading “/” slash. The offending lines of code are located in lib/pkp/classes/template/PKPTemplateManager.inc.php

It seemed to have installed anyway but I’m not sure if something might be messed up somewhere that I haven’t found yet.

The (sanitized) messages are as follows:

Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en_US.js) is not within the allowed path(s): (redacted) in /mypath/ojs-3.0.2/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 571
Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en.js) is not within the allowed path(s): (redacted) in /mypath/ojs-3.0.2/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 571
Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en_US.js) is not within the allowed path(s): (redacted) in /mypath/ojs-3.0.2/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 588
Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en.js) is not within the allowed path(s): (redacted) in /mypath/ojs-3.0.2/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 588

Hi @MacMike,

See [OJS 3.0] getBasePath() returns an empty path in PKPTemplateManager · Issue #1902 · pkp/pkp-lib · GitHub.

Regards,
Alec Smecher
Public Knowledge Project Team

1 Like

Dear asmecher,
On the two different domain I received the same errors and cannot install OJS 3.0.2. There are a lot of posts to this topic that I don`t know what to do. Is there simply steps what I can do to solve this problem? Last year I change the provider and solve the problem but now I have got the same problem and cannot just change provider.
I received next errors:

Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en_US.js) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 571

Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/js/lib/jquery/plugins/validate/localization/messages_en.js) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 571

Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en_US.js) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 588

Warning: file_exists(): open_basedir restriction in effect. File(/lib/pkp/lib/vendor/moxiecode/plupload/js/i18n/en.js) is not within the allowed path(s): (/home/:/usr/lib/php:/usr/local/lib/php:/tmp:/usr/local/cpanel/base/3rdparty) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 588

Warning: Cannot modify header information - headers already sent by (output started at /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php:571) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 773

Warning: Cannot modify header information - headers already sent by (output started at /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php:571) in /home/economic/public_html/lib/pkp/classes/template/PKPTemplateManager.inc.php on line 776

Hi @Lazar_Stosic,

There’s a patch at the above link that you can apply to resolve the warnings.

Regards,
Alec Smecher
Public Knowledge Project Team

Try the fix at pkp/pkp-lib#2364 Fix file existence checks for JS inclusion · pkp/pkp-lib@7820368 · GitHub that was referenced in the above response.

Just either patch or replace the file lib/pkp/classes/template/PKPTemplateManager.inc.php with the one there. The raw source is at:
https://raw.githubusercontent.com/pkp/pkp-lib/7820368dda6cd6779f2ed2348e04ad8189888fdf/classes/template/PKPTemplateManager.inc.php

1 Like

Dear @MacMike
Thank you for link. I replace all code from https://raw.githubusercontent.com/pkp/pkp-lib/7820368dda6cd6779f2ed2348e04ad8189888fdf/classes/template/PKPTemplateManager.inc.php but nothing. For patch from pkp/pkp-lib#2364 Fix file existence checks for JS inclusion · pkp/pkp-lib@7820368 · GitHub… Do I need to upload whole folder with this patch or something else? Which patch I have to change?
Thank you in advance.
Lazar

Did you redo the installation using that file? I would think I would start over from the beginning but after expanding the archive replace that file before navigating to the installation URL. Did you try that?

No. I just upload whole code via cPanel File Manager. Open PKPTemplateManager.inc.php and replace all code. Is it clever to delete a whole domain and to start from the beginning with new PKPTemplateManager.inc.php? Also, download PKPTemplateManager.inc.php from GITHUB and upload to server, and nothing.

Dear @MacMike,
I solved the problem. Inserted new PKPTemplateManager.inc.php in new installation and everything pass very well. Thank you very much for the assistance. I will try the same on the other domain to see the results.
You are the best.

I’m sure there’s a better way to do it. I think there is a setting somewhere where you can trick it into thinking the installation hasn’t been executed yet allowing you to run it again. Not sure where I saw that. I’m a newbie too so maybe someone else should jump in here to detail the ideal way to handle this situation.

I think the setting is probably the one in the config.inc.php file in the following section:

[general]

; Set this to On once the system has been installed
; (This is generally done automatically by the installer)
installed = On

Interesting. On other domain I received new errors which are not related with PKPTemplateManager.inc.php. Where I can find the patch for this?

Strict Standards: Declaration of DevelopedByBlockPlugin::getSeq() should be compatible with BlockPlugin::getSeq($contextId = NULL) in /home/ijeteach/public_html/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Strict Standards: Declaration of DevelopedByBlockPlugin::getBlockContext() should be compatible with BlockPlugin::getBlockContext($contextId = NULL) in /home/ijeteach/public_html/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Strict Standards: Declaration of DevelopedByBlockPlugin::getEnabled() should be compatible with BlockPlugin::getEnabled($contextId = NULL) in /home/ijeteach/public_html/plugins/blocks/developedBy/DevelopedByBlockPlugin.inc.php on line 79

Strict Standards: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/install/form/InstallForm.inc.php on line 146

Strict Standards: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/install/form/InstallForm.inc.php on line 148

Strict Standards: Non-static method Application::getName() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/install/form/InstallForm.inc.php on line 150

Strict Standards: Non-static method VersionCheck::getCurrentCodeVersion() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/install/form/MaintenanceForm.inc.php on line 37

Strict Standards: Non-static method Version::fromString() should not be called statically in /home/ijeteach/public_html/lib/pkp/classes/site/VersionCheck.inc.php on line 115

Strict Standards: Non-static method PKPRequest::getUserVar() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/form/Form.inc.php on line 351

Strict Standards: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/core/PKPRequest.inc.php on line 582

Hi all,

Applying that change to your PKPTemplateManager.inc.php won’t require a re-install. Note that it’s a little risky to copy newer versions of the file in wholesale – best practice is to use the standard patch tool to apply only the required changes. However, I think in this case you won’t get into trouble.

The “Strict Standards” warnings are cosmetic and can be ignored. Many of these will be resolved in the OJS 3.1 release.

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks asmecher. I found one your post that this is cosmetic warnings and if we choose SQLi the problem will be solved. I did that and the warnings disappeared.
Thank you a lot.

Dear asmecher,
After installing fresh copy OJS3.0.2 and new database (no upgrade) I received just loading page in OJS. On the left side have only Tasks and Administration. When click on the Hosted journal’s webpage tried to load the page but nothing. Where is the problem?

Hi @Lazar_Stosic,

Have you checked your PHP error log for details?

Regards,
Alec Smecher
Public Knowledge Project Team

Yes. A lot of errors like
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method ScheduledTaskHelper::checkFrequency() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/plugins/generic/acron/PKPAcronPlugin.inc.php on line 315
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method ScheduledTaskHelper::_isInRange() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/scheduledTask/ScheduledTaskHelper.inc.php on line 114
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method Request::getContext() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/lib/pkp/classes/plugins/ThemePlugin.inc.php on line 409
[14-Jul-2017 17:19:39 UTC] PHP Strict Standards: Non-static method PKPRequest::_checkThis() should not be called statically, assuming $this from incompatible context in /home/ijeteach/public_html/classes/core/Request.inc.php on line 68

I had something similar happen to me. The screenshot you provided doesn’t show it but did you have any journal configuration links or options in the upper right area of the screen?

If so try creating a journal as that fixed the loading and missing navigation options for me.

Hi @Lazar_Stosic,

Those “strict standards” warnings are cosmetic and can be ignored – you’ll be looking for something that’s an error, not a warning. (FYI, we’ve resolved a lot of these warnings for the next release, so they should go away once that version is out.)

Regards,
Alec Smecher
Public Knowledge Project Team

That is the problem. I installed a fresh copy of OJS 3.0.2 on the new domain. Everything passed very well, but when I click on Hosted journal I received just loading page and nothing else. A lot of strict standard warnings and no one error. I will remove all folders and files, delete the database and try to install it again. Cannot find the post with similar mistakes.

Hi @Lazar_Stosic,

If I were debugging this, I’d also use a tool like Firebug for Firefox or Chrome’s built-in developer tools to inspect the response the web server is giving to the request for the tasks list. It’s possible that you’ll find e.g. an error message there as well.

Regards,
Alec Smecher
Public Knowledge Project Team