Re: error logging into website

From: Axel Schwenke <axel.schwenke_at_gmx.de>
Date: Thu, 15 Nov 2018 16:16:39 +0100
Message-ID: <psk2ko$a9r$1_at_dont-email.me>


On 15.11.2018 16:01, Ammammata wrote:
> after she typed username and password, she got the following error:
>
> Fatal error: Uncaught Error: Call to undefined function mysql_connect() in
> /is/htdocs/wp11016416_AGPG3LGMKP/www/include/function.php:9 Stack trace: #0
> /is/htdocs/wp11016416_AGPG3LGMKP/www/login/login.php(4): connect_mysql() #1
> /is/htdocs/wp11016416_AGPG3LGMKP/www/index.php(10):
> include('/is/htdocs/wp11...') #2 {main} thrown in
> /is/htdocs/wp11016416_AGPG3LGMKP/www/include/function.php on line 9

[Quoted] That is not a MySQL error, it's a PHP error.

> I'm worried by the "Call to undefined function" part since nobody has admin
> access to the source code

It's not so much a problem of the source code (I assume it worked before and wasn't changed). It rather looks like PHP was updated and now lacks the "mysql" extension that provides the mysql_connect() function.

This extension has been marked deprecated for ages. PHP code should use mysqli or PDO_MySQL. See https://secure.php.net/manual/en/intro.mysql.php

Depending on what has happened, there are several ways to proceed:

  1. install the mysql extension for PHP (provided it's available for the PHP version running now) - or
  2. downgrade PHP to a version that has the mysql extension - or
  3. rewrite the PHP code to use i.e. mysqli; if this is some 3rd party application, it maybe just needs to be updated.
Received on Thu Nov 15 2018 - 16:16:39 CET

Original text of this message