Blank Screen on Fresh Install of OJS 2.4.8

Hi all,

I’m getting a blank screen on going to the default page. Enabling errors on the page gives me this:

Deprecated: Non-static method PKPApplication::defineExposedConstant() should not be called statically in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 545

Deprecated: Non-static method PKPApplication::getExposedConstants() should not be called statically in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 513

Fatal error: Cannot use ‘String’ as class name as it is reserved in /var/www/html/ojs/lib/pkp/classes/core/String.inc.php on line 57

Any suggestions?

Thanks,
Tim

Hi @tauyeung,

I suspect you’re using PHP7, which introduced a new String class which clashes with our own. For the moment, I would suggest using an older PHP. We’ll be adapting OJS around the PHP7 changes once it hits a reasonable fraction of web hosts (soon, but not yet).

Regards,
Alec Smecher
Public Knowledge Project Team

That seemed to move us along. I yanked PHP7 and installed PHP5.6. What modules do I need? I’m getting this error:

Fatal error: Call to undefined function xml_parser_create() in /var/www/html/ojs/lib/pkp/classes/xml/XMLParser.inc.php on line 272

Here are the modules loaded:

[PHP Modules]
calendar
Core
ctype
date
dom
ereg
exif
fileinfo
filter
ftp
gettext
hash
iconv
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
Phar
posix
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
sysvmsg
sysvsem
sysvshm
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zlib

[Zend Modules]
Zend OPcache

Never mind – looks like apache2 just needed another reboot. Things seem to be working now.

Mmmm something happed similar to me… i change to a php 5.6 but my error msn seems bigger now.

Strict Standards: Non-static method PKPApplication::defineExposedConstant() should not be called statically in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 545

Strict Standards: Non-static method PKPApplication::getExposedConstants() should not be called statically in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 513

Deprecated: Non-static method PhpQuickProfiler::getMicroTime() should not be called statically, assuming $this from incompatible context in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/PKPProfiler.inc.php on line 28

Deprecated: Non-static method Console::init() should not be called statically, assuming $this from incompatible context in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/lib/pqp/classes/PhpQuickProfiler.php on line 25

Deprecated: Non-static method Console::logMemory() should not be called statically, assuming $this from incompatible context in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 60

Deprecated: Non-static method Console::logSpeed() should not be called statically, assuming $this from incompatible context in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 61

Deprecated: Non-static method PhpQuickProfiler::getMicroTime() should not be called statically, assuming $this from incompatible context in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/lib/pqp/classes/Console.php on line 80

Strict Standards: Non-static method Core::getBaseDir() should not be called statically in /var/www/vhost/revistaaquatic.com/home/html/ojs/lib/pkp/classes/core/Core.inc.php on line 21

and much more…
any help?

Hi @antilo,

All the messages you quoted are cosmetic and shouldn’t cause problems – look for anything that mentions a “fatal error”.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi, … done… the problem was on the configuration of my php, after change to php 5.6 hundreds of errors were showed, i switch off the display errors setup… and seems that everything work properly, as you say … seems that was just comsetic problems.

I ran into same issue when moving OJS 2.4.8 from Ubuntu php 5.6 to Ubuntu 16 php 7, error:

Deprecated: Non-static method PKPApplication::defineExposedConstant() should not be called statically in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 545

Deprecated: Non-static method PKPApplication::getExposedConstants() should not be called statically in /var/www/html/ojs/lib/pkp/classes/core/PKPApplication.inc.php on line 513

Fatal error: Cannot use ‘String’ as class name as it is reserved in /var/www/html/ojs/lib/pkp/classes/core/String.inc.php on line 57

in this case you need to switch php 7 to php 5.6 here are the steps, log in as root#:

apt-get update && apt-get upgrade
apt-get install -y software-properties-common
add-apt-repository ppa:ondrej/php
apt-get update
apt-get install -y php5.6
a2dismod php7.0 ; a2enmod php5.6 ; service apache2 restart
update-alternatives --config php
php -v

source for full instruction: