Blank Page on OJS 2.4.8-4 after PHP 7 is Turned On....help

I am currently using OJS 2.4.8-4 and need to upgrade to OJS 3. Is there a guide for the upgrade?

Right now, whenever I turn on PHP 7 on OJS 2.4.8-4, I get a blank page. I am getting this error from the log file. Can someone please tell me how to fix this?

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Application has a deprecated constructor in /public_html/classes/core/Application.inc.php on line 36
[22-May-2019 07:26:22 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PKPApplication has a deprecated constructor in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 39
[22-May-2019 07:26:22 UTC] PHP Deprecated: Non-static method PKPApplication::defineExposedConstant() should not be called statically in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 545
[22-May-2019 07:26:22 UTC] PHP Deprecated: Non-static method PKPApplication::getExposedConstants() should not be called statically in /public_html/lib/pkp/classes/core/PKPApplication.inc.php on line 513
[22-May-2019 07:26:23 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /public_html/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php:354

Thanks so much for your help.

Hi @newone,

This means you should change mysql connector to mysqli in config.inc.php

1 Like

Thanks @Vitaliy! That worked.

how?.. can’t find one… can you please help me? or is there an alternative way?

thanks

hi @newone! how did you fix the error? can you teach me how to do it? thanks

Open config.inc.php (in root folder where you installed OJS), then find Database settings section, and change line driver = mysql to driver = mysqli

1 Like

Hi @jovinmaneja. I just saw this. I see that @Dragoljub_Djordjevic already responded. I will also respond since I feel so darn special. :blush:

I asked my web hosting company to update to PHP 7. I then changed the following in the config.inc.php file. This file is in the top directory of OJS.

You will find that the Database settings begin on line 115 in config.inc.php file:

;;;;;;;;;;;;;;;;;;;;;
; Database Settings ;
;;;;;;;;;;;;;;;;;;;;;

[database]

driver = mysql
host = localhost

Change it to this:

;;;;;;;;;;;;;;;;;;;;;
; Database Settings ;
;;;;;;;;;;;;;;;;;;;;;

[database]

driver = mysqli
host = localhost

After that, everything will be fine and there will be no error.

-Newone

I have changed it to mysqli but the error message still appears. I’m using OJS 2.4.8-5

PHP Version 7.2.26
MySQL Version 10.2.30-MariaDB

Capture2 Capture3

Hi @reza_chan,

Those errors on the screenshot look like cosmetic and can be ignored.