Monday, June 22, 2015

Windows, Nginx, MariaDB...and sometimes SQLServer

I have a couple projects at work that are quite different.

All are using PHP.

Some projects require connecting to MSSql (SQL Server).

Other projects are Drupal based.

I had been using XAMPP for awhile now, but knew I wanted to use Nginx on Windows, so I finally took the leap and got it running.


Here's a great stack to use for Windows, PHP, Nginx, XDebug, and MariaDB:  http://wpn-xm.org/


Now, in my case I needed to interface with a SQL Server database for other projects. The Microsoft Drivers for PHP for SQL Server are located here: https://msdn.microsoft.com/en-us/sqlserver/ff657782.aspx

BUT (at the time of this writing) PHP 32-bit is required for these SQL Server drivers, so make sure you download the correct package from WPN-XM. This was my "gotcha" that took awhile for me to get this running. I was getting "could not find driver" even though the correct versions were available.


I've got some more learning to do, but so far I've got multiple projects running with some accessing MSSQL and others MariaDB, all using Nginx and PHP. The speed difference compared to Apache is remarkably noticeable.

Also for my Drupal projects, I was able to do a simple export from MySQL and then an import into MariaDB. My Drupal sites needed no changes in-order-to run, other than a server config in the nginx.conf file.





No comments:

Post a Comment