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

MDL-25910 still not okay, mysqli_connect rquires port to be integer

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.1
    • 2.0.2
    • Installation
    • None
    • MySQL
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

    Description

      Continuing on MDL-25910... I've upgraded to the latest $release = '2.0.1+ (Build: 20110204)';
      After upgrade, I modified my config.php to this:

      $CFG->dbtype = 'mysqli';
      $CFG->dbhost = 'localhost';
      $CFG->dbname = 'moodle_openwide';
      $CFG->dbuser = 'moodle_openwide';
      $CFG->dbpass = pass;
      $CFG->prefix = 'mdl_';
      $CFG->dblibrary = 'native'; // 'native' only at the moment
      $CFG->dboptions = array(
      'dbpersist' => false,
      'dbsocket' => '/web/mysql/mysql.sock',
      'dbport' => '',
      );

      Based on the comments in config_dist.php this should work. But it is not. I got the following error in php log:

      [06-Feb-2011 18:42:24] PHP Warning: mysqli::mysqli() expects parameter 5 to be long, string given in /web/www/openwide-moodle/lib/dml/mysqli_native_moodle_
      database.php on line 281
      [06-Feb-2011 18:42:24] PHP Warning: mysqli::set_charset() [<a href='mysqli.set-charset'>mysqli.set-charset</a>]: Couldn't fetch mysqli in /web/www/
      openwide-moodle/lib/dml/mysqli_native_moodle_database.php on line 291
      [06-Feb-2011 18:42:24] PHP Warning: mysqli_native_moodle_database::get_server_info() [<a href='mysqli-native-moodle-database.get-server-info'>mysqli-native-
      moodle-database.get-server-info</a>]: Couldn't fetch mysqli in /web/www/openwide-moodle/lib/dml/mysqli_native_moodle_database.php on line 331
      [06-Feb-2011 18:42:24] PHP Warning: mysqli_native_moodle_database::get_server_info() [<a href='mysqli-native-moodle-database.get-server-info'>mysqli-native-
      moodle-database.get-server-info</a>]: Couldn't fetch mysqli in /web/www/openwide-moodle/lib/dml/mysqli_native_moodle_database.php on line 331
      [06-Feb-2011 18:42:24] PHP Warning: mysqli::query() [<a href='mysqli.query'>mysqli.query</a>]: Couldn't fetch mysqli in /web/www/openwide-moodle/lib/dml/
      mysqli_native_moodle_database.php on line 774
      [06-Feb-2011 18:42:24] PHP Fatal error: Call to a member function fetch_assoc() on a non-object in /web/www/openwide-moodle/lib/dml/mysqli_native_moodle_
      database.php on line 779

      it's clear, that mysqli_native_moodle_database.php on line 281 there is a bug. I could resolve it by doing the change in the attached picture. Nevertheless the (int) conversion some lines above the mysqli_connect, the function call still not working.
      It seems, ini_get retrieves a string, and this is the problem.

      Attachments

        Activity

          People

            skodak Petr Skoda
            eliast Éliás Tamás
            Matteo Scaramuccia, Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              21/Feb/11