I’m working on moving an OJS 3 upgrade (which works on my localhost) to a new server, and am getting the following error message in my PHP error log. Is this telling me something’s wrong with the PHP installation, or that I need to install pear? Or is it a permissions issue? When I try to access from the web, I get a 500 error.
Any help is appreciated! The server is running PHP 5.6.
PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
PHP Fatal error: Unknown: Failed opening required ‘/var/www/html/guelph/index.php’ (include_path=’.:/usr/share/pear:/usr/share/php’) in Unknown on line 0
When exactly do you get those errors? I do not know what are your steps (what have you done), but maybe to go step by step, e.g. first to see that the apache2 and your domain is working correctly, than a simple php page, than maybe a clean/new ojs, etc…
pear is not needed, I think… permissions could be, but… as I said, best to go step by step…
So it looks like my original issue was a problem with SELinux, and I’m now getting a different error in my log:
PHP Fatal error: Call to a member function getPrimaryLocale() on null in /var/www/html/guelph/classes/i18n/AppLocale.inc.php on line 108
I created a new empty OJS instance on the same server and it worked, so that doesn’t appear to be the issue. I also tested the mysqli connection, as noted in another forum post, and that was connecting fine. Any thoughts on what could be causing this?
It sounds to me like there are no entries in your site table – if this is an upgraded installation, are you sure it upgraded successfully? If it’s a new install, is it possible that the installation didn’t complete?
Regards,
Alec Smecher
Public Knowledge Project Team
Hmm, it’s possible that your cache files are causing trouble. Try manually erasing all .php files from cache/ to see if they get recreated by OJS as you use it.
Regards,
Alec Smecher
Public Knowledge Project Team
OK, this suggests you’ll need to work with file permissions. Check the README document, and in this forum there’s a FAQ entry on permissions too. Once you have permissions set correctly, you should be able to delete cache/*.php and see PHP files get re-generated there as you access the site. (If you see that, it’s not a clear indication that you have permissions set correctly – but it’s a good sign.)
Regards,
Alec Smecher
Public Knowledge Project Team
I wanted to follow up in case anyone else has this issue!
The problem was that our database cluster didn’t support MyISAM storage, so it needed to be converted to innoDB. Once we fixed that, it resolved these problems.
[Wed Mar 20 15:08:28.527034 2019] [:error] [pid 16030] [client 192.168.0.1:55336] PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0
[Wed Mar 20 15:08:28.527087 2019] [:error] [pid 16030] [client 192.168.0.1:55336] PHP Fatal error: Unknown: Failed opening required '/var/www/html/ffyl_ojs3114/index.php' (include_path='.:/usr/share/pear:/usr/share/php') in Unknown on line 0
And these errors are resulted by SELinux is enabled in my Centos 7 Server. So I left the commands that I have used to resolve this problem: