Moodle 2.1 custom development against both MS SQL Server and MySQL

Moodle 2.1 custom development against both MS SQL Server and MySQL

by Andrew Zoltay -
Number of replies: 4

Hi,

We've been doing our development in a Windows environment using Xampp, hosting our production environment on a LAMP server for a few years and it's worked great...right up until Moodle 2.1. Our moodle database sits in MySQL, but we have a couple customizations that requires access to MS SQL Server 2005 databases, so we're accessing different DBMS's through the same code base. Up until now, we've been using the php_mssql.dll api calls to manage this without any problem.

Here's what's happened when we decided to upgrade to Moodle 2.1:

- Moodle 2.1 requires PHP 5.3.2, so we need to upgrade our Xampp environment. No problem from a PHP point of view Xampp supports it, however, Xampp 1.7.4/1.7.5beta (and Wamp) have excluded the php_mssql library from the PHP build. This kills our customizations that access the MS SQL Server databases.  Microsoft has released a new set of drivers for PHP, but Xampp and Wamp haven't included these libraries either.

I investigated development in PHP under IIS in the Windows environment, but there "may" be issues between IIS and Apache that "could" cause us grief when migrating to production - seems kinda risky.

Our current "plan" is to do development remotely on a linux server using an IDE (Netbeans/Eclipse) on our local machines. That way we can control the Apache/PHP build and include the libraries we need.

Does anyone have any ideas to solve our driver dependancy problem in a Windows environment?

Thanks!

Cheers,
Andy

Average of ratings: -
In reply to Andrew Zoltay

Re: Moodle 2.1 custom development against both MS SQL Server and MySQL

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes. Installing Apache and PHP yourself is sensible way.

In reply to Tim Hunt

Re: Moodle 2.1 custom development against both MS SQL Server and MySQL

by Andrew Zoltay -

I had figured it's probably the best long term solution, but thought I'd poke the community to see if there were any other brilliant ideas out there I had overlooked.

Thanks.

In reply to Andrew Zoltay

Re: Moodle 2.1 custom development against both MS SQL Server and MySQL

by Anne Krijger -

Hi Andy,

I'm not sure what the difference is of using a Linux server.

Xampp just makes it easy to set up the Apache Mysql PHP combination, but once it is installed you can change it as easely as you could on a linux machine I'd think (running xampp on my dev machine and linux on all the servers).

 

The main problem I think is that mssql seems not really supported anymore in PHP 5.3  ; http://social.msdn.microsoft.com/Forums/nl-NL/sqldriverforphp/thread/55268c68-9d37-4b0f-ad0e-4213bad1d182

and you therefor need to hack PHP to be able to continue mssql.
Sounds a bit strange though that you wouldn't be able to use mssql with PHP anymore...
Does that mean you'd have to use ODBC instead of 'native' mssql ?

Anne.

In reply to Anne Krijger

Re: Moodle 2.1 custom development against both MS SQL Server and MySQL

by Andrew Zoltay -

Hi Anne,

Xampp just makes it easy to set up the Apache Mysql PHP combination, but once it is installed you can change it as easely as you could on a linux machine I'd think (running xampp on my dev machine and linux on all the servers).

Xampp has worked well for us in the past without having to change it.  I've evaluated a couple solutions and like the new one I've come up with using an IDE on my local (Windows) box connecting to a remote development server (Linux).  I did a proof of concept which worked almost flawlessly (apart from an SVN hiccup).  Can run xdebug too! I had originally thought about trying to swap stuff in and out of Xampp, but I didn't know enough about how to do it and we already have the knowledge for the LAMP world. 

Sounds a bit strange though that you wouldn't be able to use mssql with PHP anymore...
Does that mean you'd have to use ODBC instead of 'native' mssql ?

We've compiled PHP 5.3.3 on Suse to use the php_mssql library and haven't had any problems, although we are using a limited set of the api calls.  We haven't had to go to the ODBC.

When we migrate our SQL Server database to 2008, we'll make the switch to the new Microsoft driver, but until then, we'll continue to work with the php_mssql one.

Cheers,
Andy