Installing modle 1.9.8 problems on windows server 2003

Installing modle 1.9.8 problems on windows server 2003

by Deleted user -
Number of replies: 23

I need an absolute honest answer.... Has anyone actually gotten Moodle 1.9.8+ working with the following configuration:

  • Windows Server 2003
  • IIS 6
  • Microsoft SQL Server 2005
  • PHP 5.3.2 (nts)
  • FastCGI 1.5 (x86) RTW
  • FreeTDS 0.82 + 20090904 patches (nts)
  • Moodle 1.9.8+

I've been tring to get the above combination to work for two weeks straight spending 9 to 10 hour per day. I have encounter ever error documented in Moodle Tracker dealing with SQL Server 2005 connectivity. I've tried every combination of FreeTDS vs ODBTP vs Microsoft provided dll as a last resort. I'm not interested in recompiling anything. I know the Windows 2003/MS SQL 2005 installation proceedures by memory. None of the suggestions in the tracker or forums seems to work for me.

I am stuck with Window Server 2003, SQL Server 2005 and IIS 6. Hence, I cannot entertain other suggested combinations. So if anyone have gotten the above combination to work, please speak up! Otherwise, I have read and tried all other suggestions out there in google land and moodle land.

Average of ratings: -
In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

Yes, I have. But for now I'm sticking with PHP 5.2. Moodle works fine on the 5.2.x branch. Do you have the option of using one of the 5.2.x versions of PHP? If so, then I can certainly say that the your combination will work on 5.2.x.

Have a look at this thread: http://moodle.org/mod/forum/discuss.php?d=145275. It seems that getting the Moodle / PHP 5.3.x combination to work can be a bit tricky.

Have you turned on the error logging option in FreeTDS and in PHP to try and see where your problem is?

Is your version of FreeTDS the same as the one from Installing_MSSQL_for_PHP? You don't need to recompile FreeTDS if you use one of the binaries on that page.

To add a "5th gear" to your setup you should install a PHP Accelerator such as eAccelerator or the Windows Cache Extension for PHP that Microsoft released a few months back (I haven't really tried it, eAccelerator is working fine for me). Then PHP, and Moodle, will really "kick ass"!

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

Thanks for the response. Yes I can currently use PHP 5.2.12. I will try it out tomorrow. But with in 6 months or less it may be mandatory to upgrade to PHP 5.3. I was trying to upgrade and solve all the problems now rather than later. But I'm willing to postpone the headace.

Yes, i'm using the recommended FreeTDS. I've turned on error logging in the PHP.ini, Config.php and I can't remember if i turned it on in FreeTDS (i think i did). I looked up a hand full of error messeges without find any satisfactory answers. At one point I got that peskey 4004 error. That's when I tried the ODBTP option that didn't work. I was also having trouble with the NTEXT, NVARCHAR and NCHAR  and MS SQL 2005. So I search the moodle installation code for NTEXT, NVARCHAR and NCHAR and remove all the N's. I'm able to get to the final installation page (i think) and when I click the continue button, the IE browser tries to perform the next operation but the page seems to be in an endless cycle until it times out which I got two error messages:

  • Could not create guest user record
  • could not create admin user record

This is the point where I broke down and decided to ask for help. I will try PHP 5.2.12 tomorrow after which I may ask for additional help. Thanks.

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

The NTEXT/NVARCHAR/etc. problems are probably caused by something in your FreeTDS configuration. It really isn't necessary to Modify the Moodle source code and change the datatypes that it uses. That's just asking for trouble - as you've seen with the errors that you mentioned.

What have you got in your freetds.conf file?

Are you using $CFG->dbtype = 'mssql_n'; in your Moodle config.php file?

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

After two weeks of trying various configurations, I was down to changing database types to get a little futher into the install process. My settings are the same as this awesome installation guide for the above configuration:

http://www.moodlewindows.za.net/

my freetds.conf file:

[global]

  • host = x.xxx.xx.xxx
  • port = 1433
  • client charset = UTF-8
  • tds version 8.0
  • text size = 20971520

My moodle config file:

  • $CFG->dbtype = 'mssql_n';
  • $CFG->debugdisplay = true;
  • $CFG->debug = 2048;
  • $CFG->dblogerror = true;
  • ... plus the default settings from the config-dist.php file

Since you got moodle working with the above configuration, could you list the versions of the various products in your configuration? I forgot to mention that i'm using Windows 2003 Server SP2.

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -
After removing the Ns from the data types i tried to install with the configuration of $CFG->dbtype = 'mssql_n'; That didn't work so I tried $CFG->dbtype = 'mssql'; and I got much futher than any other previous configuration of files suggested in the forum. But as I posted earlier, it ultimately didn't work. I now get a login link and a tiny moodle logo on the moodle webpage, but when I click the login link IE goes into an endless cycle and never seems to time out.
In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

I would recommend persevering with dbtype = 'mssql_n' instead of hacking around with 'mssql'. You might get it to "work" now, but it could come back and bite you later...

Your freetds.conf file is ok, so that's not the problem. Can you show us your php.ini file? And attach the output of the PHPInfo() command.

Did you set these options when you created your Moodle database:
ANSI NULLS Enabled = true
Quoted Identifiers Enabled = true

Which SQL Server service pack have you got. SP 2 is the minimum, SP 3 recommended. You might get unicode problems with SP 1.

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

What Server Roles is your database user a member of? The database user should at least be a member of db_owner. I think db_datareader, db_datawriterand, db_ddladmin are also required. Check this in the User Mapping tab of the Login Properties dialog for your database user in Management Studio.

When you start the setup Moodle displays the Server Checks screen. Are there any errors on that screen or does it say that all requirements have been met?

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Jon Price -
This might be an obvious one... but have you checked that the following settings are set up on the database?

  • ANSI NULLS Enabled = true
  • Quoted Identifiers Enabled = true
If they aren't, remove everything from the Moodle install (all database tables, config.php and the contents of the moodledata folder) and then try again - I had something similar, and that appeared to work for me.

If that's not it, I'll have a rethink - I've got a similar installation, the only difference being the operating system - running a local installation on a Windows XP Pro machine as an initial testing box - getting it to work was an absolute pain, but it is possible.

In reply to Jon Price

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

Yes, I have those two values set. Here is a great installation guide for :

Windows Server 2003 + IIS 6 + MS SQL Server 2005 + PHP 5.2.6 + FastCGI 1.5 + FreeTDS (from moodle.org) + Moodle 1.9.x

http://www.moodlewindows.za.net/

The only difference is that i'm using PHP 5.3.2 (nts), FreeTDS .82+20090904 (nts), moodle 1.9.8. So my PHP and Moodle is newer.

Yesterday I started a brand new installation without any modifications and once again got the very first error I got two plus weeks ago:

"A problem occurred inserting current version into databases"

I read over the following two links amoung others and tried most of the recommendations:

Yes, I'm using the correct FreeTDS recommended by moodle.org

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

For PHP 5.3 have you set the default timezone in php.ini? See: http://moodle.org/mod/forum/discuss.php?d=145275#p642149

And did you check the Server Roles that I described in my earlier reply?

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

Yes I changed the timezone sometime last week.

Okay, I whipped out the database and moodle files and started from semi-scratch once again. I re-created the database and set the following settings as described in you installation guide:

usermapping:

  • db_datareader,
  • db_datawriterand,
  • db_ddladmin 
  • This time is set the db_ower which is not set in your guide but you mentioned it above.

Server Rolls:

  • bulkadmin checked
  • dbcreator checked
  • public checked
  • securityadmin checked
  • setupadmin checked

I started moodle installation from scratch and let it build the config file. Here are the results:

Installation screen:

  • PHP version - Pass
  • Session Auto Start - Pass
  • Magic quotes Run Time - Pass
  • Insecure Handling of Globals - Pass
  • Safe Mode - Pass
  • File Upload - Pass
  • GD version - Pass
  • Memory Limit - Pass

Clicked next >>

Checking your environment...

  • unicode - OK
  • database - mssql - OK
  • php - 5.3.2 - OK
  • php_extension iconv - OK
  • php_extension mbstring - OK
  • php_extension curl - OK
  • php_extension openssl - OK
  • php_extension tokenizer - OK
  • php_extension xmlrpc - OK
  • php_extension ctype - OK

Click next >>

I clicked the yes button

The the database setup stuff started processing. At the bottom of the screen I get the not so unique 4004 error message:

4004: Unicode data in a Unicode-only collation or ntext data cannot be sent to clients using DB-Library (such as ISQL) or ODBC version 3.7 or earlier.

ADOConnection._Execute(SELECT * FROM mdl_config WHERE id = '-1', false) % line 891, file: adodb.inc.php

ADOConnection.Execute(SELECT * FROM mdl_config WHERE id = '-1') % line 1469, file: dmllib.php

insert_record(config, Object:object) % line 676, file: moodlelib.php

set_config(unicodedb, 1) % line 198, file: index.php

Most of these post are old but you'll find plenty of references if you google the error message.

Ok, so I click next >>

I get the pink box with the following error message:

"A problem occured inserting current version into database"

http://moodle.org/mod/forum/discuss.php?d=137171

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -

Mmm...

Please attach your php.ini file.

Does it contain these values:

log_errors = On
...
error_log = "PHPErrors.log"
...
mssql.textlimit = 20971520
mssql.textsize = 20971520

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

The answer is yes to each of your questions.  It will take a while to get approval to post the php.ini file. I can quote some of the errors posted to the PHPErrors.log. 

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

The following are error messages are a sampling from the PHPErrors.log:

  • SQL Invalid object name 'mdl_config'. in D:\wwwtest\moodle\lib\dmllib.php on line 609. STATEMENT: SELECT * FROM mdl_config with limits (, )
  • SQL Invalid object name 'mdl_course'. in D:\wwwtest\moodle\lib\dmllib.php on line 481. STATEMENT: SELECT * FROM mdl_course WHERE category = '0' with limits (-1,1)

...

  • SQL Invalid object name 'mdl_context'. in D:\wwwtest\moodle\lib\dmllib.php on line 481. STATEMENT SELECT * FROM mdl_context WHERE contexlevel = '10' with limits (-1,1)
  • PHP Strict Standards: Creating default object from empty value in D:\wwwtest\moodle\theme\standardwhite\config.php on line 9
  • PHP Strict Standards: Declaration of XMLDBmssql:: getRenameFieldExtraSQL() should be compatible with that of XMLDBgenerator:: getRenameFieldExtraSQL() in D:\wwwtest\moodle\lib\xmldb\classes\generators\mssql\mssql.class.php on line 588

the errors goes on forever.

In reply to Luis de Vasconcelos

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

This person is having the same problem with FreeTDS : http://moodle.org/mod/forum/discuss.php?d=146635

If you have indeed gotten PHP 5.2 Or 5.3 working with SQL Server 2005 and FastTDS, then please list the versions of the files you got to work for you.

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Jon Price -

The FastCGI I've installed was found here:-
http://www.iis.net/download/fastcgi

As I'm using XP Pro as the server, I've used the appropriate version (x86) - you should ensure that the one you use is the correct one for Windows Server 2003.

With IIS, all of the extensions should be compiled in VC9, and match the thread version (TS/NTS) of the PHP installation. As you're getting some connectivity, I'm assuming that that probably isn't so much the problem as it must be connecting to set up tables, but there's a setting it doesn't like somewhere. The settings I have in my freetds.conf file are as follows:-

[global]
host = localhost
instance = SQLEXPRESS
port=1433
client charset = UTF-8
tds version = 8.0
text size = 20971520

The only difference I can see between these and yours are that I'm using a named instance of SQL Server (which if you're not, just omit the line) and that you are missing the '=' in the tds version line - is this also omitted in your freetds.conf file? If so, try correcting it and then uninstalling/reinstalling all the moodle stuff again. The FreeTDS file I used was downloaded from the 'installing mssql' page on here (0.82 + 20090904 patches).

I really found it a pain as every time something went wrong with the installation, I had to delete all of the tables from the database, the config.php file and everything out of the moodledata folder before it would even consider progressing to the next error! There's no need to delete the moodle installation or the database itself though.

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Jon Price -
Is it set on 'mssql', or 'mssql_n'?

If it's on 'mssql', repeat the 'remove everything and try again' step and... try again using 'mssql_n' (UTF-8)!

If it's set on 'mssql_n' then it may be something related to FreeTDS/setup - can you check phpinfo() for the mssql settings and post them here?
In reply to Jon Price

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

The config file is set to nssql_n.

mssql settings are:

  • Active Persistent Links = 0
  • Active Links = 0
  • Library version = FreeTDS
  • mssql.allow_persistent = on/on
  • mssql.batchsize = 0/0
  • mssql.charset = UTF-8/UTF-8
  • mssql.compatability_mode = off/off
  • mssql.connect_timeout = 5/5
  • mssql.datetimeconvert = on/on
  • mssql.max_links = unlimited/unlimited
  • mssql.max_persistent = unlimited/unlimited
  • mssql.max_procs = unlimited/unlimited
  • mssql.min_error_severity = 10/10
  • mssql.min_message_severity = 10/10
  • mssql.secure_connection = off/off
  • mssql.textlimit = 20971520/20971520
  • mssql.textsize = 20971520/20971520
  • mssql.timeout = 60/60

In reply to Jon Price

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

The config file is set to mssql_n.

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Luis de Vasconcelos -
That's correct. Have you installed any of the MSSQL 2005 Service Packs? If so, which one?
In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Ankit Prajapati -
Hi,

Please see the link http://moodle.org/mod/forum/discuss.php?d=135908#p598125

and follow the steps as per the document attached in that forum. Then after if you find any difficulty let me know.

Don't forget to rate it if you think it is useful document for the installation.

Thanks.

Ankit Prajapati

In reply to Ankit Prajapati

Re: Installing modle 1.9.8 problems on windows server 2003

by Deleted user -

HI Ankit,

I notice you used PHP5ISAPI.DLL with IIS6. I'm using FastCGI. Where you able to get it to work using Fast CGI?

In reply to Deleted user

Re: Installing modle 1.9.8 problems on windows server 2003

by Ankit Prajapati -
Please let me know in which step you want to use FastCGI so that I can try with that and let you know.

Also can you tell me what error you are getting?

Thanks