Note: You are currently viewing documentation for Moodle 2.0. Up-to-date documentation for the latest stable version is available here: Installing MSSQL for PHP.

Talk:Installing MSSQL for PHP: Difference between revisions

From MoodleDocs
Line 28: Line 28:


:Hi Christopher, in first term I'd try to take a look to the output of phpinfo();, in the mssql section, to see if the driver (and which one) has been really loaded. Also, it would be great to know a bit more about what OS/PHP/DBLIB versions are being used in your site. The error "Call to undefined function" seems to indicate that the driver hasn't been loaded, for any reason, hence connection fails. But I cannot say too much else. Current drivers are supposed to work under any Win32 flavour and PHP 5.2. Ciao, [[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 17:44, 5 May 2009 (UTC)
:Hi Christopher, in first term I'd try to take a look to the output of phpinfo();, in the mssql section, to see if the driver (and which one) has been really loaded. Also, it would be great to know a bit more about what OS/PHP/DBLIB versions are being used in your site. The error "Call to undefined function" seems to indicate that the driver hasn't been loaded, for any reason, hence connection fails. But I cannot say too much else. Current drivers are supposed to work under any Win32 flavour and PHP 5.2. Ciao, [[User:Eloy Lafuente (stronk7)|Eloy Lafuente (stronk7)]] 17:44, 5 May 2009 (UTC)
Wow thanks for the quick reply!  Oddly enough I don't see an mssql section on the phpinfo() output.  Tons of other stuff, but not that one.
This is running on Windows Server Standard 2003, PHP 5.2.9-2 (from the Web Platform Installer), and used the php_dblib.dll from your article.  I think it's 0.82?
A little info if any of this helps from phpinfo()
Server API CGI/FastCGI
Configuration File (php.ini) Path C:\WINDOWS
Loaded Configuration File C:\Program Files\PHP\php.ini
PHP API 20041225

Revision as of 18:30, 5 May 2009

Are the ODBTP instructions for ODBTP.conf incorrect? According to moodle forum[1], the ODBTP.conf must point to the host of the ODBTP service, not the MSSQL server.

I can only verify this for Windows, no idea about unix.

Hi Ben, I've updated the documentation. All my tests were/are with both the ODBTP service + the MSSQL server in the same host so I never had that problem. Thanks for pointing to it! Eloy Lafuente (stronk7) 09:50, 16 July 2007 (CDT)

Also, unlike the other methods described in this article, we are not given a clue as to what to put for the $CFG->db... parameters in config.php, especially $CFG->dbtype. --Richard Enison 07:45, 9 June 2008 (CDT)

Hi Richard, the correct parameter for proper MSSQL-UTF8 connections is: $CFG->dbtype = 'mssql_n', going to insert that somewhere in the page. Thanks! Eloy Lafuente (stronk7) 12:40, 19 June 2008 (CDT)

And I presume that the statement in the ODBTP section that reads: (where /path/to/your/odbtp.conf" is usually "/usr/local/etc/odbtp.conf"" for Unix systems and "C:|odbtp|odbtp.conf" for Windows systems) should look like (where "/path/to/your/odbtp.conf" is usually "/usr/local/etc/odbtp.conf" for Unix systems and "C:\odbtp\odbtp.conf" for Windows systems). When I copied it from the article and pasted it here, the vertical bars turned into backslashes, so I replaced them with vertical bars to show what it really looks like. Richard Enison 11:39, 22 March 2009 (UTC)

Hi Richard, I think it was a "visual" thing, where backslashes in italic text was looking like vertical bars (that's the cause your copy & paste worked ok, because they were correct backslashes). I've changed the italics to bold in the page to avoid any confusion. Thanks! --Eloy Lafuente (stronk7) 21:59, 22 March 2009 (UTC)

php_dblib.dll not loading

Thanks for a fantastic step-by-step post. I'm positive I've got the big stuff covered. I'm just down to this.

I've got php_dblib.dll in the ext directory ... .NET Framework 1.1 ... c:\freetds.conf, etc.

But I get this error: Call to undefined function mssql_connect()

If I change php.ini to load php_mssql.dll it works. If I switch it to load php_dblib.dll, it just doesn't seem to find it. I changed file perms to everyone/full control on almost everything.

If I turn on startup errors, I get a timeout, even when changing script execution to 600 seconds...so I can't debug it further.

Any thoughts on what I'm doing wrong? It has to be something incredibly minor.

Hi Christopher, in first term I'd try to take a look to the output of phpinfo();, in the mssql section, to see if the driver (and which one) has been really loaded. Also, it would be great to know a bit more about what OS/PHP/DBLIB versions are being used in your site. The error "Call to undefined function" seems to indicate that the driver hasn't been loaded, for any reason, hence connection fails. But I cannot say too much else. Current drivers are supposed to work under any Win32 flavour and PHP 5.2. Ciao, Eloy Lafuente (stronk7) 17:44, 5 May 2009 (UTC)

Wow thanks for the quick reply! Oddly enough I don't see an mssql section on the phpinfo() output. Tons of other stuff, but not that one.

This is running on Windows Server Standard 2003, PHP 5.2.9-2 (from the Web Platform Installer), and used the php_dblib.dll from your article. I think it's 0.82?

A little info if any of this helps from phpinfo()

Server API CGI/FastCGI Configuration File (php.ini) Path C:\WINDOWS Loaded Configuration File C:\Program Files\PHP\php.ini PHP API 20041225