News Archive
PhpRiot Newsletter
Your Email Address:

More information

Install PHP applications with WebMatrix

Note: This article was originally published at Planet PHP on 10 July 2010.
Planet PHP

Microsoft has recently launched a beta release of a new project called WebMatrix. This is a complete web development stack that can be used toAstart developing and deploying web sites. One thing that may be not so obvious from all the existing announcements is the fact that WebMatrix has full support for installing, running and publishing PHP applications.

Here are the examples of how WebMatrix can be used to create and publish a PHP web site (using WordPress as a showcase).

Installing a PHP application

After installing and launching WebMatrix select aoSite from Web Gallerya option and then pick WordPress:

Follow the installation steps as described in Download and Install a PHP application. As you proceed you will notice that WebMatrix downloads and installs the necessary components for running WordPress - the latest version of PHP 5.2 and MySQL. At the end of the installation process you will get a working instance of WordPress, that you can configure and customize further:

Notice the port number used in the URL. This is not the standard port 80 used by default in IIS. The site is not running on IIS that is included with operating system. Instead WebMatrix installs and uses IIS Express, which is a developer-focused version of IIS that runs on all versions of Windows, starting from Windows XP. This is actually very cool because now it is possible to get the latest and greatest IIS features on Windows XP instead of using the good old IIS 5.1 as development web server . But even if you already have Windows 7, you may still want to use IIS Express, because with that you do not need to enable real IIS Web Server included with OS on your development machine.

Even though IIS Express is a lightweight development server it comes with everything needed to run PHP applications, including the latest version of FastCGI module and URL Rewrite 2.0. This means that after you install WordPress with WebMatrix you can enable WordPress' pretty permalinks by following the instructions at IIS URL Rewrite Module support in WordPress.

Note: By default WebMatrix and IIS ExpressAare not configured to run PHP even if PHP is already installed on the machine.ATo work this around Ainstall any PHP application via WebMatrix UI. This way WebMatrixAwill configure IIS Express to handle PHP requests. This is something that will be fixed in future releases of WebMatrix.

Modifying a PHP application

After the WordPress is installed there are several things you can do with it from within WebMatrix. For example you can edit the theme files by using the built-in editor:

You can check what kind of HTTP requests are made by Web Browser to load a typical WordPress page:

(Learn more about this feature at Using WebMatrix Beta: Analyze Your WebSite)

Also, you can check the WordPress database content by using the WebMatrix Database Manager:

And, finally, you

Truncated by Planet PHP, read more at the original (another 2674 bytes)