Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-51928

Deprecate ADODB MySQL driver - it calls functions that no longer exist in PHP7

    XMLWordPrintable

Details

    • MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_35_STABLE

    Description

      At the moment, the MySQL extension is deprecated and will be removed on PHP7.

      While testing an external db connection with MySQL, I've got the warnings:

       
      PHP Deprecated:  mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /home/moodle/moodles/stable_master/moodle/lib/adodb/drivers/adodb-mysql.inc.php on line 458
      

      We should consider, either migrate auth_db and enrol_db instances to mysqli (which has few differences from mysql) or deprecate the use of the adodb mysql driver, by giving a debugging message when it is selected (or some other solution).

      This now gives the following error in php7:

      Exception - Call to undefined function mysql_connect()
       
      Error code: generalexceptionmessage
      Stack trace:
       
          line 461 of /lib/adodb/drivers/adodb-mysql.inc.php: Error thrown
          line 492 of /lib/adodb/drivers/adodb-mysql.inc.php: call to ADODB_mysql->_connect()
          line 652 of /lib/adodb/adodb.inc.php: call to ADODB_mysql->_nconnect()
          line 165 of /auth/db/auth.php: call to ADOConnection->Connect()
          line 111 of /auth/db/auth.php: call to auth_plugin_db->db_init()
          line 4180 of /lib/moodlelib.php: call to auth_plugin_db->user_login()
          line 144 of /login/index.php: call to authenticate_user_login()
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              lameze Simey Lameze
              Votes:
              5 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: