I’ve just set up SQL Server Express on our staging server cause I needed to interface Moodle with a customers existing SQLServer database for authentication.
This wasn’t as simple as I thought it would be, but after some set backs I got it working
Firstly, TCP connections to SQL Server Express are switched off by default to prevent newbie users opening themselves up to potential remote attack. Here’s a link to instructions on how to enable TCP connections: How to: Configure Express to accept remote connections.
Also note from the comments on the PHP mssql_connect function documentation that the hostname and port in the connection string are delimited using a comma ‘,’ rather than the more common colon ‘:’. E.g.
-
-
mssql_connect(‘localhost,1433′, ‘myusername’, ‘mypass’);
-
The first problem I encountered after this was an ‘Unable to connect to server’ error. By scanning the user comments on the PHP mssql_connect function page I noticed that a key step in fixing the problem was to replace the PHP5 provided ntwdblib.dll with a newer one from the MS SQL Client Tools. However, this DLL no longer ships with MS SQL Server Express. Luckily I had a developer installation of SQL Server 2000 on my XP partition and was able to pick up version 2000.80.2039.0 from that.
However, I then ran into another problem. When I replaced the PHP 5 provided version ntwdblib.dll of with the new one and restarted IIS, the output from phpinfo() showed that the mssql extension wasn’t loading anymore. I couldn’t see any errors reported in browser nor the system error logs.
By chance I decided to run php -i on the command line. This was lucky cause this way a system error dialog popped up a warning about a missing DLL dependency.
The problem was that the new ntwdblib.dll had a dependency on MSVCR71.DLL which couldn’t be found in IIS’ path. I did a search for msvcr*.dll in C:\WINDOWS and found a copy of this DLL in C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\. I copied it into my PHP install dir and restarted IIS. Then when I ran phpinfo() again the extension showed up.
Edd Dumbill posted an interesting article on his blog about his development infrastructure: In search of agile infrastructure for web applications.
He makes extensive use of
- Ubuntu/Debian cause of their stability and ease of setup.
- Virtualization with Xen, VMWare and Parallels cause it allows him to run multiple test/staging servers on one piece of hardware. Plus it allows him to scratch and rebuild a server with minimum fuss.
- .deb packaging his web apps cause it makes deployment and upgrades nice, neat, and easy.
- SVK or BazaarNG for source control in order to take advantage of their distributed development capabilities and easier merging.
- avahi for mDNS (also known as Rendezvous / Bonjour / ZeroConf) - to make temporary DNS setup dynamic.
Thanks for sharing Edd
Finally managed to find the documentation for the standard Gnome and GTK command line options. I’d been googling for this information a couple of times recently without success. Searching for ‘gnome command line options’ wasn’t bringing up the authoritative reference I expected it to. The key word missing from the search was ’standard’. When I added that the first result page lists a online man page half way down for ‘gnome-options’. Anyway now I’ve found them I’m noting this permanently.
Note: I’ve linked to Andreas Gohr’s (creator of dokuwiki) man.splitbrain.org man page site as it’s got a really nice interface and lists both gtk-options and gnome-options whereas the original link I found to die.net doesn’t list both.
Found a link to a good set of instructions for setting up PHP on IIS 6.
How to install PHP 5.x on Windows Server 2003 with IIS 6
Having to get PHP 5 running with IIS 6 on Windows Server 2003 today. I was finding the process quite interesting until I wanted to check the error logs to find out the cause of an HTTP 500 error. It seems the default IIS setup doesn’t provide an easy way to get error logging info out of it. I totally agree with the sentiments expressed here. At least Apache comes setup out of the box to allow developers, developers, developers to do their job.
Then I found this page on the Microsoft site, seems I may have to write a VBScript to coax IIS into outputting it’s errors to the system error log :-|. I’m hoping something in the IIS Resource Kit will make my life easier.
Since upgrading to XP Pro I’ve been wondering why I could no longer access the fine-grained Access Control Lists for files and directories that used to be available in the Security tab of the file/folder Properties dialog in Win2k. Instead there’s this very friendly file sharing tab instead, which although simple isn’t what I want.
However I’ve just located the setting that needs to be changed to give me back control over the system!
First open Explorer and from the menu bar select ‘Tools > Folder Options’ and click the ‘View’ tab from the dialog that appears. Scroll to the bottom of the Advanced Settings panel and you’ll see an option titled ‘Use simple file sharing (Recommended)’. This will be set by default on XP (unless, I believe, it’s XP Pro and has been added to a domain). Switching it off puts back the Security tab.
Found a great site today: Sysinternals Freeware. It hosts various interesting and useful freeware Windows system monitoring utilities such as:
- Filemon
- For monitoring filesystem activety. Watch open files and see the processes which are accessing them. A lot like
lsof on Linux.
- Autorun
- Generates a comprehensive listing of all applications configured to run during system bootup and login. I always knew a lot of stuff ran (cause of the huge time it takes to boot my laptop) so I was impressed to see the entire list finally. Maybe I can now start to work out how to cut the boot time down a bit.
- Regmon
- A lot like Filemon but monitors real-time access to the registry instead.
This is just a taster of what’s there. There are loads of other valuable looking tools there for exploring Windows’ internals.
One of the site’s owners, Mark Russinovich, has an interesting weblog on the site as well: Mark’s Sysinternals Blog. Seems he’s been digging into the internals of Sony’s DRM root kits recently: Sony, Rootkits and Digital Rights Management Gone Too Far.