OJS 3.0.2 Http 500 error on migration to new hosting company

I’m in the process of transferring from one hosting company to another. I am testing my website on the new host before adjusting name servers. Files were restored from a full cPanel backup.

I get an Http 500 error when trying to access any ojs page.

The error log in the ojs directory shows the following:

[22-Jan-2019 08:48:08 Europe/London] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/*******/public_html/ojs/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php:456

Stack trace:

#0 /home//public_html/ojs/lib/pkp/lib/adodb/adodb.inc.php(558): ADODB_mysql->_connect(‘localhost’, '’, , ‘_ojs2’)

#1 /home//public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php(144): ADOConnection->Connect(‘localhost’, '’, *******, *******’, false)

#2 /home/*******/public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php(119): DBConnection->connect()

#3 /home/*******/public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php(76): DBConnection->initConn()

#4 /home/*******/public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php(52): DBConnection->initDefaultDBConnection()

#5 /home/*******/public_html/ojs/lib/pkp/classes/db/DBConnection.inc.php(220): DBConnection->__construct()

#6 /home/*******/public_html/ojs/lib/pkp/classes/core/PKPApplication.inc.php(158): DBConnection::getInstance()

#7 in /home/*******/public_html/ojs/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php on line 456

[I’ve blanked out a few bits for obvious reasons]

I’m running OJS v3.0.2.0

Server OS: Linux

Apache version: 2.4.37

PHP version: 5.6.39

The website is on a shared IP on both old and new hosting company.

Does anyone have any suggestions of how to resolve this? I’m not technical!

Besides the files, OJS saves data in a relational database such as MySQL. Did you restore that in the new hosting as well? If so, the database names, user credentials and the sql server address may need to be adjusted in your config.inc.php.

Also, you might need to select another PHP database driver in the configuration, depending on what is available on your hosting:

It seems like mysqli and postgres are supported database connectors:

Thanks for your response.

The database was transferred and the configuration file includes the correct credentials. I tried changing the driver from MySQL to mysqli in the configuration file, but the result was the same Http 500 error.

Hi @Douand22,

You might want to create a test php file on the server with one line in it: <?php phpinfo(); ?> and then load that file in the browser. It will tell you what database extensions are enabled. Please delete the file after you view it, since they can be a security concern if left alone.

you may need to ask your systems admin to enable a PHP module for you.

Cheers,
Jason

Hi, many thanks for that suggestion. I ran phpinfo and it has produced a lengthy result. I’m not sure how to interpret it, but I can see a mysqli section, but no mysql.

So I’ve amended config.inc.php to mysqli from mysql. However, I still get the Http 500 error. Is there anything else I would also need to change, or should I be looking for anything else in phpinfo?

Update: it turns out that the php was version 7, not 5.6.39 as previously reported. This has now been downgraded, and the Http 500 error has been resolved. Thank you ojsbsb and jnugent for your responses.

However, a different error is not apparent: pdf galleys do not download, but I’ll open a new thread for that

1 Like

Glad to hear that the problems are worked out. I’ll mention that I run OJS 3.1.1-4 on a test instance with PHP 7 and things work fine, so that’s still an option if you upgrade in the future.