Moodle
  1. Moodle
  2. MDL-6823

Installation on MS SQL with several SQL instances on one server

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.7
    • Fix Version/s: 1.7, 1.8
    • Component/s: Installation
    • Labels:
      None
    • Environment:
      1.7 from 4. october on a Win 2003 server with IIS 6 and PHP 5.1.6. The SQL server is MSSQL 2005 on a different server.
    • Database:
      Any
    • Affected Branches:
      MOODLE_17_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      28042

      Description

      Installer is not able to connect to the SQL server, I have tried both secure WIN and SQL login. mysql_connect works fine on same server from a PHP script.

      I suspect the problem is the handeling of several SQL instances on one server, my hostname is like 'SERVERNAME\instancename'. When I recieve the error that Moodle cannot connect to the server, an extra slash has been added so the host is now 'SERVERNAME\instancename'.

        Activity

        Hide
        Thomas Forsberg added a comment -

        Sorry, there is a typo in the last servername, the one that shows up with the error message, should be 'SERVERNAME//instancename'. An additional '/' is added every time you submit the page.

        Show
        Thomas Forsberg added a comment - Sorry, there is a typo in the last servername, the one that shows up with the error message, should be 'SERVERNAME//instancename'. An additional '/' is added every time you submit the page.
        Hide
        Martin Dougiamas added a comment -

        Can you connect with just one instance on the server?

        Have you set up PHP to make sure it has all the MS SQL modules?

        I also believe PHP can't connect to SQL server directly, you need to use ODBC wrapping ...

        Show
        Martin Dougiamas added a comment - Can you connect with just one instance on the server? Have you set up PHP to make sure it has all the MS SQL modules? I also believe PHP can't connect to SQL server directly, you need to use ODBC wrapping ...
        Hide
        Thomas Forsberg added a comment -

        I have set up the MSSQL support in PHP and ODBC is also in stalled, but no additional modules. I currently only have multi instance SQL servers to test against.

        I only have basic knowledge about PHP and databases, so I could really need some documentation on how to set this up or at least some sample config files to do more testing and maybe set up a single instance MSSQL to see if that really is the issue.

        Show
        Thomas Forsberg added a comment - I have set up the MSSQL support in PHP and ODBC is also in stalled, but no additional modules. I currently only have multi instance SQL servers to test against. I only have basic knowledge about PHP and databases, so I could really need some documentation on how to set this up or at least some sample config files to do more testing and maybe set up a single instance MSSQL to see if that really is the issue.
        Hide
        Thomas Forsberg added a comment -

        Additional info: I have made a manual config.php and it connects to the MSSQL and creates the databases without any errors. That should mean that the PHP <> MYSQL connection is OK and that thae connection problem is an issue with the installer.

        But, on the next screen I get the error "A problem occurred inserting current version into databases". I am not able to track down what this error means, have tried to change the setting mssql.datetimeconvert in php.ini and recreated the DB, but still the same error.

        Show
        Thomas Forsberg added a comment - Additional info: I have made a manual config.php and it connects to the MSSQL and creates the databases without any errors. That should mean that the PHP <> MYSQL connection is OK and that thae connection problem is an issue with the installer. But, on the next screen I get the error "A problem occurred inserting current version into databases". I am not able to track down what this error means, have tried to change the setting mssql.datetimeconvert in php.ini and recreated the DB, but still the same error.
        Hide
        Thomas Forsberg added a comment -

        I am still trying to sort this out..

        It might be a connection issue with the installer, but when I update config.php manually, it do connect and make the databases on the SQL 2005 server.

        The problem then is the next step where I get the error message "A problem occurred inserting current version into databases". As far as I can find out does this indicates that it cannot write/read the version to the database. I am not able to find any proper dokumetation on this.

        Anyone who can post a php.ini and a config.ini that actually works with M 1.7 and Microsoft SQL server ? If I get some documentation or working sample files I might be able to isolate if the problem, right now there are just too many unknowns.

        Show
        Thomas Forsberg added a comment - I am still trying to sort this out.. It might be a connection issue with the installer, but when I update config.php manually, it do connect and make the databases on the SQL 2005 server. The problem then is the next step where I get the error message "A problem occurred inserting current version into databases". As far as I can find out does this indicates that it cannot write/read the version to the database. I am not able to find any proper dokumetation on this. Anyone who can post a php.ini and a config.ini that actually works with M 1.7 and Microsoft SQL server ? If I get some documentation or working sample files I might be able to isolate if the problem, right now there are just too many unknowns.
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Thomas,

        there is a huge problem with MSSQL when talking with PHP and trying to use UTF-8. Basically, the standard mssql PHP extension is based on some old client libraries that haven't been updated (by MS?) in ages.

        But lucky, there are some solutions (at least two from the research I performed some months ago). Basically, both of them use an alternative mssql extension that replace the original one and provide reliable UTF-8 communications between PHP and MSSQL servers.

        You can find some more info about the problem and its solution in:

        http://docs.moodle.org/en/XMLDB_Problems#MSSQL.2C_PHP.2C_UTF-8_and_UCS-2

        Just now there isn't any "installation guide" in Moodle Docs about how to install such libraries (I hope this will change soon, I'm trying to write something useful right now).

        Basically, the steps you have to follow are:

        • Install and configure the alternative mssql extension.
        • Configure your config.php file properly (it's pretty standard, with each field with their normal meaning)
        • Install & Run

        (note that the second point will be performed by Moodle install script, but for now it isn't supported)

        Hope this helps, once I have something written in Docs, I'll post the link here (of course, feel free to ask here any problem you find, sure it helps to write a better guide).

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Thomas, there is a huge problem with MSSQL when talking with PHP and trying to use UTF-8. Basically, the standard mssql PHP extension is based on some old client libraries that haven't been updated (by MS?) in ages. But lucky, there are some solutions (at least two from the research I performed some months ago). Basically, both of them use an alternative mssql extension that replace the original one and provide reliable UTF-8 communications between PHP and MSSQL servers. You can find some more info about the problem and its solution in: http://docs.moodle.org/en/XMLDB_Problems#MSSQL.2C_PHP.2C_UTF-8_and_UCS-2 Just now there isn't any "installation guide" in Moodle Docs about how to install such libraries (I hope this will change soon, I'm trying to write something useful right now). Basically, the steps you have to follow are: Install and configure the alternative mssql extension. Configure your config.php file properly (it's pretty standard, with each field with their normal meaning) Install & Run (note that the second point will be performed by Moodle install script, but for now it isn't supported) Hope this helps, once I have something written in Docs, I'll post the link here (of course, feel free to ask here any problem you find, sure it helps to write a better guide). Ciao
        Hide
        Thomas Forsberg added a comment -

        Thank you ! The site now works with ODBTP installed, BUT:

        I still have have problems with the install script, after installing ODBTP the connection error was now gone, but now I get a blank screen after the DB definition screen and nothing happened. No tables was created.
        When I made the config.php manually, it ran flawlessly and created the tables and the site seems to work perfectly.

        Thomas

        Show
        Thomas Forsberg added a comment - Thank you ! The site now works with ODBTP installed, BUT: I still have have problems with the install script, after installing ODBTP the connection error was now gone, but now I get a blank screen after the DB definition screen and nothing happened. No tables was created. When I made the config.php manually, it ran flawlessly and created the tables and the site seems to work perfectly. Thomas
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Hi Thomas,

        thanks for your feedback!

        yep, the install script hasn't been modified yet to support installation of Moodle against MSSQL (will be soon!) so the only posibility of make it work is using manual editing of the config.php file.

        I'll be update this track once mssql installation was working from the installer script.

        Also, yesterday, I introduced one new article to:

        http://docs.moodle.org/en/XMLDB_Documenting_everything

        it's about installing of ODBTP/TDS. Hope it helps to make live easier to everybody! Of course, feel free to update, improve it with your experiences!

        Ciao

        Show
        Eloy Lafuente (stronk7) added a comment - Hi Thomas, thanks for your feedback! yep, the install script hasn't been modified yet to support installation of Moodle against MSSQL (will be soon!) so the only posibility of make it work is using manual editing of the config.php file. I'll be update this track once mssql installation was working from the installer script. Also, yesterday, I introduced one new article to: http://docs.moodle.org/en/XMLDB_Documenting_everything it's about installing of ODBTP/TDS. Hope it helps to make live easier to everybody! Of course, feel free to update, improve it with your experiences! Ciao
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Some ideas about the work in progress to avoid forgetting them:

        Show
        Eloy Lafuente (stronk7) added a comment - Some ideas about the work in progress to avoid forgetting them: Ask directly for the ADOdb driver flavour. Provide one standard help link to the http://docs.moodle.org/en/Installing_MSSQL_for_PHP page
        Hide
        Eloy Lafuente (stronk7) added a comment -

        Now, the installer:

        • performs Oracle charset checks (both client and server)
        • prefix checks
        • shows differnt information foreach DB flavour
        • provide one link to Moodle Docs for MSSQL and Oracle
        • the ODBC connector has been marked as experimental due
          to confirmed problems by MS

        lang-packs for the installer will be generated in some hours, so tomorrow, I'll perform final checks.

        Show
        Eloy Lafuente (stronk7) added a comment - Now, the installer: performs Oracle charset checks (both client and server) prefix checks shows differnt information foreach DB flavour provide one link to Moodle Docs for MSSQL and Oracle the ODBC connector has been marked as experimental due to confirmed problems by MS lang-packs for the installer will be generated in some hours, so tomorrow, I'll perform final checks.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: