Uncaught Error: Call to undefined function mysql_connect()

when i try to install ojs 3.02 to my aws serwer, i take HTTP 500 error and i see the bellow error in appache log file.

PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php:456\nStack trace:\n#0 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/lib/adodb/adodb.inc.php(558): ADODB_mysql->_connect(‘localhost’, ‘xxxx’, ‘yyyy’, ‘’)\n#1 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/classes/db/DBConnection.inc.php(144): ADOConnection->Connect(‘localhost’, ‘xxxx’, ‘yyyy’, NULL, false)\n#2 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/classes/db/DBConnection.inc.php(119): DBConnection->connect()\n#3 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/classes/db/DBConnection.inc.php(106): DBConnection->initConn()\n#4 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/classes/db/DBConnection.inc.php(55): DBConnection->initCustomDBConnection(‘mysql’, ‘localhost’, ‘xxxx’, ‘yyyy’, NULL, false, ‘utf8’)\n#5 /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/classes/install/PKPInstall.inc.php in /home/admin/web/ijsmartgrid.com/public_html/lib/pkp/lib/adodb/drivers/adodb-mysql.inc.php on line 456, referer: http://ijsmartgrid.com/index.php/index/install/install

Here xxx and yyy values of user and pass are true. i can connect db with phpmyadmin.
Can you helpme about this issue

Hi @oeyeci,

What version of PHP are you using? If it is PHP 7 you may need to select the MySQLi driver rather than the MySQL driver.

Best,
Amanda Stevens
Public Knowledge Project Team

1 Like

I have the same problem with PHP version 7
how can select MySQLi driver?
Thanks

when i’ve change MysQLi. database connection failed! pls help
this error log :
[18-Apr-2019 06:28:44 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Smarty has a deprecated constructor in /home/jimfbior/public_html/lib/pkp/lib/vendor/smarty/smarty/libs/Smarty.class.php on line 64
[18-Apr-2019 06:28:44 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADODB_Cache_File has a deprecated constructor in /home/jimfbior/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 263
[18-Apr-2019 06:28:44 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADOConnection has a deprecated constructor in /home/jimfbior/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 359
[18-Apr-2019 06:28:44 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet has a deprecated constructor in /home/jimfbior/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 2921
[18-Apr-2019 06:28:44 UTC] PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ADORecordSet_array has a deprecated constructor in /home/jimfbior/public_html/lib/pkp/lib/adodb/adodb.inc.php on line 3939
[18-Apr-2019 06:28:44 UTC] ojs2: Database connection failed!

To anyone dealing with this in the future, change the config.inc file to say:
driver = mysqli
host = localhost

Very easy fix when updating OJS…at least to 3.2…