PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect()

Started by harryhood, June 12, 2021, 06:49:43 AM

Previous topic - Next topic

harryhood

My forum was working fine up until late yesterday morning, then it starting throwing a 500 internal error. database settings table shows version 2.0.13. Php on the server is 5.6.40, which should be compatible I think.

Subs-Db-mysql.php shows version 2.0.9 in the header

Assuming the php and SMF forums are compatable, any idea why this would happen and what I can do to fix?

additional info below

*
* @version 2.0.9
*/

500 error:

This page isn't working hxxp:forum.northeastjeep.org [nonactive] is currently unable to handle this request.
HTTP ERROR 500

error for apache log:
PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /home/homedir/public_html/forum/Sources/Subs-Db-mysql.php:58

version from settings table:

smfVersion: 2.0.13


phpinfo

northeastjeep.org/phpinfo.php

shadav

are you sure about your php level?

usually this error occurs after the php has been upgraded above 7 as that function was removed in php 7+

try resetting your php

you really should upgrade as most hosts are getting rid of php 5
smf 2.0.18 is made to work with php 7.4

shawnb61

shadav is correct.  mysqli support wasn't added until smf 2.0.14.  So smf is trying to load the old mysql driver, but it doesn't appear to be present in your php env.  Pretty sure it is normally part of php 5.6.  Hopefully it's just a matter of re-enabling  mysql in php.ini.



Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

mathx

This seems not to fix things.

I untarred the large upgrade for 2.0.18 right overtop of the forum 2.0.13 directory, and yet I am still getting mysql_connect() errors.

Uncaught Error: Call to undefined function mysql_connect() in /var/www/html/forum/Sources/Subs-Db-mysql.php:58

I have php7.3-mysql installed on debian 10.10:
ii  php7.3-mysql                  7.3.29-1~deb10u1            amd64        MySQL module for PHP

Do I need mysqli instead? I dont see in Sources/Subs-Db-mysql.php where it differentiates php5 vs 7 to call some other non-mysql_connect() function.

Please advise.

mathx

    58                          'db_select_db' => 'mysql_select_db',

Advertisement: