Showing posts with label tip. Show all posts
Showing posts with label tip. Show all posts

Wednesday, July 7, 2010

WebMatrix PHP Editor

Yesterday Scott Guthrie announced WebMatrix, a new tool from Microsoft which lowers the barriers to entry for creating your own .NET based website. It features all the newest Microsft treats which Guthrie has introduced over the last week: IIS Express, Compact SQL Server, and Razor.

Tonight, rather than playing with all these new toys, I was able to setup WebMatrix as an IDE for an existing PHP website I manage. A screenshot (clicky, please):



It's pretty, by far the best looking PHP IDE I've tried. And easy to use; everything about it screams simplicity (which is good and bad: no intellisense, no right-click context menu). Still a huge improvement over my previous editor: Filezilla and TextPad :)

Two big complaints: the Publish functionality wasn't working well for me (I update to an ftp site, WebMatrix updates *all* files everytime) and my site doesn't render perfectly in the browser (css-related stuff, not sure if it's an IIS Express).

I did have to go through a bit of pain to get IIS Express to render php pages. Detailed issue below:
  • Trying to load a .php page, I recieved a HTTP 404.3 error: "The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map."
  • The handler is not present! I spent quite a bit of time trying to manually update the .config file (I think I was updating the wrong one - %WebMatrixInstall%/config/applicationHost.config?? Anybody know?) before finding this post which details how to add a php handler to IIS 7.0 and IIS 7.5 (and IIS Express, which is based on IIS 7.5) via appcmd.exe.

And how to fix it:

  • Open a command prompt at your WebMatrix install directory (mine is "C:\Program Files (x86)\Microsoft WebMatrix"
  • For the following command, replace the scriptProcessor parameter with your proper path to php-cgi.exe and run: " appcmd set config /section:handlers /+"[name='PHP_via_FastCGI',scriptProcessor='C:\Program Files (x86)\PHP\php-cgi.exe',path='*.php',verb='*',modules='FastCgiModule',resourceType='Either']" "
  • Do the same with this command: " appcmd set config -section:system.web
    Server/fastCgi /+"[fullpath='C:\Program Files (x86)\PHP\php-cgi.exe']" /commit:a
    pphost "
  • It works (for me)!

All in all, I was very impressed with WebMatrix and IIS Express. I'll be using WebMatrix to manage my PHP site in the future and I hope to play with Razor and SQL Express soon!

Wednesday, April 21, 2010

Setting up SVN

I've used this guide from Coding Horror several times over the past year. It takes the reader through the install and configuration of a simple SVN server. The end solution is hosted as a Windows Service and provides simple user authentication.

Also, Programming Nightmare does not directly borrow its name from Coding Horror :-)

Friday, April 16, 2010

DBML (LINQ to SQL) Wonkiness

I like using DBML (LINQ to SQL) as an ORM system when I'm doing work in C#.NET. It's far from a perfect solution but it's easy to use and expandable (partial classes for the win).

Visual Studio 2008 has a graphical DBML file editor which allows you to drag tables from a SQL Server database onto its canvas. Probably the biggest pain working with this setup comes when making DB changes and you need to reflect those changes in this graphical editor. The best solution I've come up with in doing this is to basically delete all the tables you've updated, then drag them back onto the canvas. Unfortunately this requires deleting stored procedures that return an object of that table type.. So you have to re-add those as well, which makes this non-scalable solution. (If you have a better update solution, please post it!)

This is where the wonkiness comes in. I've had the following happen a few times: I have the DB Server connected inside Visual Studio and at the same time I'm making updates to it within SQL Server Management Studio. Changes are made to the database within Management Studio and I'll need to go through the above process in Visual Studio. Then something goofy happens. I'll be unable to add a stored procedure, receiving an error that indicates that the SP's return object does not match the Table shown in the graphical editor. Or Foreign Keys won't appear in the graphical editor or its produced code. The problem persists until Visual Studio is restarted. After a restart everything will work as expected.

This wonkiness has me caused some hair pulling over the last year. Hopefully this tip - restart Visual Studio if the graphical DMBL editor isn't behaving as expected - will save you some time.

Monday, June 8, 2009

Disable System Beep in Ubuntu

I've done this 3 times in the last three days and need a place to write it down for future reference:

How to disable the system beep in ubuntu:
Edit the file '/etc/modprobe.d/blacklist'
Add the line 'blacklist pcspkr'

Wednesday, April 29, 2009

HDTV Research - AVS Forum

I'm a loyal reader and follower of Bill Harris over at Dubious Quality. I've been reading his blog since the beginning of my time on this internet, starting with his posts at the now defunct (and still sorely missed) gonegold.com.

Bill is always an entertaining read and has introduced me to a number of interesting stories and resources, one of which is the AVS Forum. This is THE place to go if you're interested in researching or purchasing a new HDTV. It's basically a large community of experts and HD TV (and other sound and video equiptment) fanatics. Check it out. If you're thinking about purchasing, make sure you register and check out the Great Found Deals forum!

Monday, November 10, 2008

Command Prompt Here

Vista's "#1 Secret": Shift+right click to bring up a context sensitive menu, which includes the option "Open Command Window Here." Sweet.