Category Archives: SQL Server

phpBB is in the Web Application Gallery

image You might have seen me tweet about the fact that PHPBB had submitted to the Web Application Gallery a couple of weeks back. Well, it’s official – the phpBB package has been finished, tested and accepted into the Web Application Gallery. You can see the official announcement on the Microsoft Web Platform blog. That means that you can install phpBB on Windows through the Web Platform Installer (WebPI) which gives you a very simple wizard to walk through.

Try phpBB on the Microsoft Web Platform today!

 

The WebPI will take a look at the dependencies that the project has requested and pull those in as well. In the case of phpBB, this includes PHP 5.2.13 (and higher when the WebPI supports it), SQL Server (Yes, I said SQL Server!) and more. It will configure IIS for FastCGI support and the whole nine yards.

The work to accomplish all of this awesome support was done at JumpIn Camp by Nils Aderman, Chris Smith and Henry Sudhof of the phpBB core team. I’ll be talking a lot more about JumpIn Camp over the next couple of weeks but in short, JumpIn Camp was an event that I helped organize, along with Yuriy Zaytsev, Will Coleman and Bram Veenhof in Zurich, Switzerland. There were contributors from a number of the top PHP applications in the world that attended for the opportunity to work on their own projects to support various Microsoft technologies (such as IIS, WebPI, SQL Server, SQL Azure, Silverlight…) with Microsoft technology experts available for technical support.

The SQL Server patch was developed by Microsoft in line with our interoperability efforts in the open source community. The new SQL Server for PHP 1.1 driver that was released back in October, 2009 enables phpBB with UTF-8 on SQL Server, Multiple Active Record Sets (MARS) and the ability to leverage SQL Azure. phpBB has accepted that patch now in their 3.0.7 release.

There are a couple more things that are exciting about all of this to me.

First, it only took a handful of days at JumpIn Camp to pull together the WebPI package + WinCache support for superior performance on Windows. For full disclosure there was some testing and a few minor bugs fixed since then but the lions share of the work was done at JumpIn Camp.

Second, phpBB is the first of the PHP application that can be installed through the WebPI with SQL Server support. I’m hoping that it will become the trend now that the SQL Server Driver for PHP 2.0 CTP with PDO is in CTP and people can start playing with it. I know that there are several applications that are starting testing with the new driver.

Third, it was a ton of fun to get to know the folks from phpBB and all of the folks that attended JumpIn Camp. I’ve been chatting with Nils online for about 6-9 months now but this was the first time that I had met him in person.

Wrapping up – I’m looking forward to seeing a lot more of the work that came out of the JumpIn Camp wrapping up and going public over the next handful of months. It’s going to be a fun time.

More adventures with SQL Server Express

This was fun. It’s a completely different database and set of circumstances than last night’s fun and frivolity.

I finished an application, zipped up the folders and sent it off to a client. In this application there is a desktop app that talks to a web service that talks to a SQL Server 2005 Express database. Sounds fairly simple, right? Right.

Well, the client unzips it all to a directory, sets up the virtual application for the web service and starts trying to run the desktop portion. It starts up, pulls up all of the lookups that we have in the database and it all looks good. Now, I’m on the phone and elated at how smooth this is going. At this point, the client tries to create a new record which is going well (wow, even a little drop down calendar and oooh look at that, it’s all of the types of records that I could create so I don’t have to type there… wow… and more gushing) until they try to save… At this point, there is a wonderful error that pops up –

“Failed to update database ‘database name.mdf’ because the database is read-only.”

Crud! After getting them to check the file properties and other such things, I called Patrick Steele, who has been working with me on this project, to see what he thought about it. It’s been a long day, especially after last night’s SQL Server Express issues, so I’m not thinking all that clearly. Patrick, after running through some of the same questions that I had so I’m feeling a little better about my thinking, has the thought that it might be a security issue and that the ASPNET user might not have permissions to write to that directory. Sure enough, since the ASPNET user doesn’t have permissions the database loads in read-only mode. Fix that and the database and the app work just fine.

SQL Server 2005 Express Issues

Yesterday I had to make a quick change to a SQL Server 2005 Express database that I’m using for an internal to SRT Solutions tool. I decided that the easiest way to do it was to leverage the auto-connect feature of SQL Server 2005 Express by just FTPing the mdb down, making my change and ftping it back up. This has worked a number of times in the past. Not this time. I got a “login failed for user ‘USERNAME'” when I tried to run the application. That was infuriating. I spent the next 4 hours or so working with the SQL Server Management Studio Express (Enterprise Manager lite for Express) assigning, unassigning permissions, users, attaching, detaching, backing up, restoring and everything else that I knew to do. I kept getting “User could not login to user’s default database” and general login failures. My personal favorite that I saw yesterday was “Could not attach, DatabaseName is not a primary database file. (Microsoft SQL Server, Error: 5171)”. Now, I’m usually pretty good with googling the answers, but this time I’m really coming up short.

All of this is proving to me that I’m a programmer, not an administrator. I’m digging the new functionality in SQL Server 2005 but I’m not going to be the one to administer the databases that I write code for.

Long story short – I raised the white flag. I IMed Jason Follas and asked him if he knew what was going on. He figured out that it had something to do with the master file that SQL Express was using for the auto-connect. He found this forum topic. Here’s the relevant snippet:

“When you first run SSE this way, it makes a local copy of master etc. in C:\Documents and Settings\<your user account name>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS.  That’s why it’s so slow the very first time it loads under a new user profile.  It may even timeout the first time you ever use it under a given profile.

Based on your description, it’s very possible something went bad in those files for some reason.  So, I would first make a backup and then delete the SQLExpress directory under C:\Documents and Settings\<your user account name>\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data.  That will get rid of the local copy of master, etc.  Then, reboot. ”

Well – Lance (the author of the post and author of SQL Server 2005 Express Edition Starter Kit) was absolutely right. I killed the master files (after copious backups) and rebooted the machine. It’s working like a champ now. On reboot, it regenerated the master files needed and started right up.

Thanks Lance and Jason