Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Installing PHP on Windows Server 2008

In a previous post (How to Install PHP on IIS), I described how to manually install PHP on Windows. This procedure can be used to install PHP on Windows Server 2008, but you can also install it through the Web Platform Installer.

The first step is to go to the PHP on IIS7 site and then press the Click to Install PHP on IIS button. It will then install the Web Platform Installer 2.0 beta if its not currently installed, or it will start the installer and take you to the page where you can install PHP.

After the installation, you need to set a default document to index.php if you want to be able to serve pages when browsing to your web site or virtual folder, i.e. http://www.cyprich.com/. The is done with the following steps:

  1. Click on the web site or virtual folder in the Internet Information Services Manager.
  2. Double click on Default Document in the IIS group.
  3. Press Add in the Actions section in the right sidebar.
  4. Enter index.php in the Add Default Document box. The Default Document list should then have the page listed as below.

Setting index.php to a default document.

Now you can browse to your web site and view the main page without typing index.php in the URL.

By

Opening a DWFx Document in Windows XP

A DWFx document is an AutoCAD DWF file formatted to work for Microsoft’s XML Paper Specification (XPS). This is included with Vista and viewers are available for other operating systems. XPS is a direct competitor to Adobe’s PDF technology and is better suited for graphics intensive documents.

You need the Microsoft XPS Viewer to open a DWFx document. This is already integrated into Vista, but it is also installed with the .NET 3.0 Framework or as a download for Windows XP. The viewer is built on the Windows Presentation Foundation and will work on Windows XP, 2003, Vista, and higher.

I would recommend the Autodesk Design Review application for working with DWFx’s because it provides greater functionality than Microsoft’s viewer. The application is a free download from Autodesk.

By

How to Install PHP on IIS

Installing PHP in Windows requires more than just running the PHP installation package. There are additional actions that need to be taken before you can host PHP web pages. Unfortunately, the installer doesn’t do this and you have to set it up manually yourself. You won’t find any documentation on the PHP site, but the procedure is fairly easy to follow.

The first thing you need to do is get the latest version of PHP for Windows from http://www.php.net/downloads.php. Run the installer and follow the steps until you reach the Web Server Setup form.

Select IIS CGI if you are installing PHP on IIS 5 or earlier (i.e. Windows XP). If you are using IIS 6 or 7 (Windows 2003 or 2008), use the IIS FastCGI option if its installed because it will give PHP better performance on your server.

Web Server Setup

Click on the drive icon next to PHP and select Entire feature will be installed on local hard drive. This will install all of the libraries and documentation that come with PHP. Its easier installing everything now than finding out later that you need a certain feature. I’ve also found that install PHP on C:\PHP\ works better than installing on C:\Program Files\PHP\. I’m not sure why, but there is probably a setting I’m missing when I install it in the Program Files folder.

 Choose Items to Install

You’ll get this error message at the final step of the installation:

Error trying access httpd.conf file. You will need to manually configure the web server.

Press OK and then press the Finish button when the next form is displayed.

Now you need to test the PHP installation by creating a virtual folder in IIS with a PHP page in it. Name the virtual folder as test and the web page as index.php.

Place the following code in index.php:

<?php

  echo ‘Test’;

?>

When you browse to this folder, i.e. http://localhost/test/, you will get the following error message:

Directory Listing Denied

In order for PHP to work properly, you need to modify the php.ini file, create a subfolder, and make some changes to IIS. This procedure is described in the following steps:

  1. Create a folder call Temp in the folder where PHP was installed.
  2. Open the php.ini file in an editor. This settings file is located in folder where PHP was installed.
  3. Search for upload_tmp_dir and session.save_path in php.ini. Change the locations to point to your Temp folder: C:\PHP\Temp.
  4. Go into the IIS management console and right click on Default Web Site or the web site that you created to install your PHP web site in. Select Properties and open the Home Directory tab. Press the Configuration button to open the Application Configuration form.
  5. Press the Add button and enter the following information (see image below):

    Executable: C:\PHP\php5isapi.dll
    Extension: .php
    Limit to: GET,HEAD,POST

    Add/Edit Application Extension Mapping
    Press the OK button to accept these settings. Press the OK button again to return to the Properties form.

  6. Select the Documents tab and press the Add button. Set the Default Document Name to index.php. This is the default document that gets opened when you browse to a folder (i.e. http://localhost/test/).

Test the PHP web site by browsing to it (i.e. http://localhost/test/). You should see the word Test displayed in web browser.

By

How to Install Windows Server Backup

Windows Server 2008 comes with the Windows Server Backup utility which can be used to backup folders, drives, and the system partition with Windows and installed application. This is useful for recovering your computer if the operating system needs to be reinstalled.

Windows Server Backup replaces the Backup Utility (ntbackup.exe) that was used on earlier versions of Windows. I noticed that the old ntbackup program also supports backing up the system partition with Automated System Recovery Wizard.

Installation Procedure

In order to use the Windows Server Backup, you need to install 3 components: Windows Server Backup, Command-line tools, and Windows PowerShell. The following procedure will install the required components.

  1. Press the Start button and then select Server Manager.
  2. Go to Features.
  3. Press the Add Features link.
  4. in the Add Features Wizard, select Windows PowerShell in the list of Features which check boxes.
  5. Open Windows Server Backup Features and select Windows Server Backup and Command-line tools (see image below).
    Selecting features to install to use Windows Server Backup.
  6. Press the Next button.
  7. Press the Install button on the Confirm Installation Selections form.
  8. Press the Close button after the features are installed.

2 Ways to Run the Backup

Windows Server Backup can be run as a Windows GUI application or from the command line. To run the GUI version, open the Start menu, select Administrative Tools, and then select Windows Server Backup.

The command line version can be run from the command shell with the wbadmin command. You can view available options with wbadmin /?.