Mistrealm

Programming

Installing IIS on PHP

What is PHP?
PHP is a server-side web scripting language for creating dynamic web pages (source).

Why IIS instead of Apache?
Well, to be honest, the main reason is that I had the IIS server handy. Oh, and IIS is the second most popular web server.

What is the first step?
Assuming you have an IIS server already, next you need to grab PHP. PHP versions are always changing, so you should probably go get the current version:

http://windows.php.net/download/

I am not running Apache, so I will need to pick one of the VC9 x86 versions.

Thread Safe or Non Thread Safe?
Excellent question. We will be using FastCGI to host this, so...

(source)) If PHP is used with IIS then choose PHP ... VC9 Non Thread Safe

(source) FastCGI addresses the performance issues that are inherent in CGI by providing a mechanism to reuse a single process over and over again for many requests. Additionally, FastCGI maintains compatibility with non-thread-safe libraries by providing a pool of reusable processes and ensuring that each process handles only one request at a time.

(source) ...the non thread safe binaries should be used.

So it looks like we want to grab the non-thread-safe files.

Where should I install this?
I suggest extracting your files into a version named directory, like this:

C:\PHP5214

This way, you can install multiple versions, and switch between them. This might come in handy if you run into issues upgrading later.

I want some official installation instructions
OK, go here and pick the version of IIS you use.

I am following the instructions, but what are all those extentions?
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.
;
; http://www.php.net/manual/en/intro.bzip2.php
; bzip2 functions are used to transparently read and write bzip2 (.bz2) compressed files
;extension=php_bz2.dll

; http://www.php.net/manual/en/intro.curl.php
; PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of 
; protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT,
; FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication. 
;extension=php_curl.dll

; http://www.php.net/manual/en/intro.dba.php
; These functions build the foundation for accessing Berkeley DB style databases. 
;extension=php_dba.dll

; http://www.php.net/manual/en/intro.exif.php
; With the exif extension you are able to work with image meta data. For example, you may use exif functions to read meta data of pictures taken from digital cameras by 
; working with information stored in the headers of the JPEG and TIFF images
;extension=php_exif.dll

; http://www.php.net/manual/en/intro.fileinfo.php
; The functions in this module try to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file. While 
; this is not a bullet proof approach the heuristics used do a very good job.
;extension=php_fileinfo.dll

; http://www.php.net/manual/en/book.image.php
; PHP is not limited to creating just HTML output. It can also be used to create and manipulate image files in a variety of different image formats, including GIF, PNG, JPEG, 
; WBMP, and XPM. Even more convenient, PHP can output image streams directly to a browser. You will need to compile PHP with the GD library of image functions for this to 
; work. GD and PHP may also require other libraries, depending on which image formats you want to work with.
;
; You can use the image functions in PHP to get the size of JPEG, GIF, PNG, SWF, TIFF and JPEG2000 images.
;
; With the exif extension, you are able to work with information stored in headers of JPEG and TIFF images. This way you can read meta data generated by digital cameras. The 
; exif functions do not require the GD library. 
;extension=php_gd2.dll

; http://www.php.net/manual/en/book.gettext.php
; The gettext functions implement an NLS (Native Language Support) API which can be used to internationalize your PHP applications. Please see the gettext documentation for 
; your system for a thorough explanation of these functions or view the docs at » http://www.gnu.org/software/gettext/manual/gettext.html. 
;extension=php_gettext.dll

; http://www.php.net/manual/en/intro.gmp.php
; These functions allow you to work with arbitrary-length integers using the GNU MP library. 
;extension=php_gmp.dll

; http://php.net/manual/en/book.intl.php
; Internationalization extension (further is referred as Intl) is a wrapper for » ICU library, enabling PHP programmers to perform UCA-conformant collation and 
; date/time/number/currency formatting in their scripts.
; 
; It tends to closely follow ICU APIs, so that people having experience working with ICU in either C/C++ or Java could easily use the PHP API. Also, this way ICU 
; documentation would be useful to understand various ICU functions.
; 
; Intl consists of several modules, each of them exposes the corresponding ICU API:
; 
;     * Collator: provides string comparison capability with support for appropriate locale-sensitive sort orderings.
;     * Number Formatter: allows to display number according to the localized format or given pattern or set of rules, and to parse strings into numbers.
;     * Message Formatter: allows to create messages incorporating data (such as numbers or dates) formatted according to given pattern and locale rules, and parse messages 
; extracting data from them.
;     * Normalizer: provides a function to transform text into one of the Unicode normalization forms, and provides a routine to test if a given string is already normalized.
;     * Locale: provides interaction with locale identifiers in the form of functions to get subtags from locale identifier; parse, compose, match(lookup and filter) locale 
; identifiers.
;extension=php_intl.dll

; http://php.net/manual/en/book.imap.php
; These functions enable you to operate with the IMAP protocol, as well as the NNTP, POP3 and local mailbox access methods.
; Be warned, however, that some IMAP functions will not work correctly with the POP protocol. 
;extension=php_imap.dll

; http://php.net/manual/en/book.ibase.php
; Firebird/InterBase is a relational database offering many ANSI SQL-92 features that runs on Linux, Windows, and a variety of Unix platforms. Firebird/InterBase offers 
; excellent concurrency, high performance, and powerful language support for stored procedures and triggers. It has been used in production systems, under a variety of names
; since 1981.
;
; InterBase is the name of the closed-source variant of this RDBMS that was developed by Borland/Inprise. More information about InterBase is available at » 
; http://www.borland.com/interbase/.
;
; Firebird is a commercially independent project of C and C++ programmers, technical advisors and supporters developing and enhancing a multi-platform relational database 
; management system based on the source code released by Inprise Corp (now known as Borland Software Corp) under the InterBase Public License v.1.0 on 25 July, 2000. More 
; information about Firebird is available at » http://www.firebirdsql.org/. 
;extension=php_interbase.dll

; http://php.net/manual/en/book.ldap.php
; LDAP is the Lightweight Directory Access Protocol, and is a protocol used to access "Directory Servers". The Directory is a special kind of database that holds information 
; in a tree structure.
; 
; The concept is similar to your hard disk directory structure, except that in this context, the root directory is "The world" and the first level subdirectories are 
; "countries". Lower levels of the directory structure contain entries for companies, organisations or places, while yet lower still we find directory entries for people, and 
; perhaps equipment or documents.
; 
; To refer to a file in a subdirectory on your hard disk, you might use something like:
;
;   /usr/local/myapp/docs
;  
;
; The forwards slash marks each division in the reference, and the sequence is read from left to right.
;
; The equivalent to the fully qualified file reference in LDAP is the "distinguished name", referred to simply as "dn". An example dn might be:
;
;   cn=John Smith,ou=Accounts,o=My Company,c=US
; 
; The comma marks each division in the reference, and the sequence is read from right to left. You would read this dn as:
;
;   country = US
;   organization = My Company
;   organizationalUnit = Accounts
;   commonName = John Smith
;  
; In the same way as there are no hard rules about how you organise the directory structure of a hard disk, a directory server manager can set up any structure that is 
; meaningful for the purpose. However, there are some conventions that are used. The message is that you can not write code to access a directory server unless you know 
; something about its structure, any more than you can use a database without some knowledge of what is available.
;
; Lots of information about LDAP can be found at
;      » Mozilla
;      » OpenLDAP Project
; The Netscape SDK contains a helpful » Programmer's Guide in HTML format. 
;extension=php_ldap.dll

; http://www.php.net/manual/en/book.mbstring.php
; While there are many languages in which every necessary character can be represented by a one-to-one mapping to an 8-bit value, there are also several languages which 
; require so many characters for written communication that they cannot be contained within the range a mere byte can code (A byte is made up of eight bits. Each bit can 
; contain only two distinct values, one or zero. Because of this, a byte can only represent 256 unique values (two to the power of eight)). Multibyte character encoding 
; schemes were developed to express more than 256 characters in the regular bytewise coding system.
;
; When you manipulate (trim, split, splice, etc.) strings encoded in a multibyte encoding, you need to use special functions since two or more consecutive bytes may represent 
; a single character in such encoding schemes. Otherwise, if you apply a non-multibyte-aware string function to the string, it probably fails to detect the beginning or 
; ending of the multibyte character and ends up with a corrupted garbage string that most likely loses its original meaning.
;
; mbstring provides multibyte specific string functions that help you deal with multibyte encodings in PHP. In addition to that, mbstring handles character encoding 
; conversion between the possible encoding pairs. mbstring is designed to handle Unicode-based encodings such as UTF-8 and UCS-2 and many single-byte encodings for 
; convenience
;extension=php_mbstring.dll

; http://php.net/manual/en/book.ming.php
; First of all: Ming is not an acronym. Ming is an open-source (LGPL) library which allows you to create SWF ("Flash") format movies. Ming supports almost all of Flash 4's 
; features, including: shapes, gradients, bitmaps (pngs and jpegs), morphs ("shape tweens"), text, buttons, actions, sprites ("movie clips"), streaming mp3, and color 
; transforms --the only thing that's missing is sound events.
;
; Note that all values specifying length, distance, size, etc. are in "twips", twenty units per pixel. That's pretty much arbitrary, though, since the player scales the movie
; to whatever pixel size is specified in the embed/object tag, or the entire frame if not embedded.
;
; Ming offers a number of advantages over the existing PHP/libswf module. You can use Ming anywhere you can compile the code, whereas libswf is closed-source and only 
; available for a few platforms, Windows not one of them. Ming provides some insulation from the mundane details of the SWF file format, wrapping the movie elements in PHP 
; objects. Also, Ming is still being maintained; if there's a feature that you want to see, just let us know at » http://www.libming.org/. 
;extension=php_ming.dll

; http://php.net/manual/en/book.mssql.php
; These functions allow you to access MS SQL Server database.
;
; This extension is not available anymore on Windows with PHP 5.3 or later.
;
; SQLSRV, an alternative driver for MS SQL is available from Microsoft: » http://www.microsoft.com/sqlserver/2005/en/us/PHP-Driver.aspx. The documentation is available at » 
; http://msdn.microsoft.com/en-us/library/cc296221.aspx 
;extension=php_mssql.dll

; http://php.net/manual/en/book.mysql.php
; These functions allow you to access MySQL database servers. More information about MySQL can be found at » http://www.mysql.com/.
; Documentation for MySQL can be found at » http://dev.mysql.com/doc/. 
;extension=php_mysql.dll

; http://www.php.net/manual/en/book.mysqli.php
; The mysqli extension allows you to access the functionality provided by MySQL 4.1 and above. More information about the MySQL Database server can be found at » 
; http://www.mysql.com/
; 
; An overview of software available for using MySQL from PHP can be found at Overview
; 
; Documentation for MySQL can be found at » http://dev.mysql.com/doc/.
; 
; Parts of this documentation included from MySQL manual with permissions of Oracle Corporation. 
;extension=php_mysqli.dll

; http://php.net/manual/en/book.oci8.php
; These functions allow you to access Oracle Database 11g, 10g, 9i and 8i. They support SQL and PL/SQL statements. Basic features include transaction control, binding of PHP
; variables to Oracle placeholders, and support for large object (LOB) types and collections. Oracle's scalability features such as Database Resident Connection Pooling 
; (DRCP) and result caching are also supported. 
;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11g Instant Client

; http://www.php.net/manual/en/book.openssl.php
; This module uses the functions of » OpenSSL for generation and verification of signatures and for sealing (encrypting) and opening (decrypting) data. OpenSSL offers many 
; features that this module currently doesn't support. Some of these may be added in the future. 
;extension=php_openssl.dll

; http://www.php.net/manual/en/book.pdo.php
; The PHP Data Objects (PDO) extension defines a lightweight, consistent interface for accessing databases in PHP. Each database driver that implements the PDO interface can 
; expose database-specific features as regular extension functions. Note that you cannot perform any database functions using the PDO extension by itself; you must use a 
; database-specific PDO driver to access a database server.
; 
; PDO provides a data-access abstraction layer, which means that, regardless of which database you're using, you use the same functions to issue queries and fetch data. PDO 
; does not provide a database abstraction; it doesn't rewrite SQL or emulate missing features. You should use a full-blown abstraction layer if you need that facility.
; 
; PDO ships with PHP 5.1, and is available as a PECL extension for PHP 5.0; PDO requires the new OO features in the core of PHP 5, and so will not run with earlier versions 
; of PHP.

; http://www.php.net/manual/en/ref.pdo-firebird.php
; Warning
; 
; This extension is EXPERIMENTAL. The behaviour of this extension including the names of its functions and any other documentation surrounding this extension may change 
; without notice in a future release of PHP. This extension should be used at your own risk.
;
; PDO_FIREBIRD is a driver that implements the PHP Data Objects (PDO) interface to enable access from PHP to Firebird and Interbase databases. 
;extension=php_pdo_firebird.dll
;extension=php_pdo_mssql.dll
;extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
;extension=php_pdo_sqlite.dll

; http://php.net/manual/en/book.pgsql.php
; PostgreSQL database is Open Source product and available without cost. Postgres, developed originally in the UC Berkeley Computer Science Department, pioneered many of the 
; object-relational concepts now becoming available in some commercial databases. It provides SQL92/SQL99 language support, transactions, referential integrity, stored
; procedures and type extensibility. PostgreSQL is an open source descendant of this original Berkeley code. 
;extension=php_pgsql.dll

; http://php.net/manual/en/book.phar.php
; The phar extension provides a way to put entire PHP applications into a single file called a "phar" (PHP Archive) for easy distribution and installation. In addition to 
; providing this service, the phar extension also provides a file-format abstraction method for creating and manipulating tar and zip files through the PharData class, much 
; as PDO provides a unified interface for accessing different databases. Unlike PDO, which cannot convert between different databases, Phar also can convert between tar, zip 
; and phar file formats with a single line of code. see Phar::convertToExecutable() for one example.
;
; What is phar? Phar archives are best characterized as a convenient way to group several files into a single file. As such, a phar archive provides a way to distribute a 
; complete PHP application in a single file and run it from that file without the need to extract it to disk. Additionally, phar archives can be executed by PHP as easily as 
; any other file, both on the commandline and from a web server. Phar is kind of like a thumb drive for PHP applications.
;
; Phar implements this functionality through a Stream Wrapper. Normally, to use an external file within a PHP script, you would use include() 
;extension=php_phar.dll

; http://php.net/manual/en/book.pspell.php
; These functions allow you to check the spelling of a word and offer suggestions. 
;extension=php_pspell.dll

; http://php.net/manual/en/book.shmop.php
; Shmop is an easy to use set of functions that allows PHP to read, write, create and delete Unix shared memory segments. 
;extension=php_shmop.dll

; http://www.php.net/manual/en/book.snmp.php
; SNMP Functions. NT only
;extension=php_snmp.dll

; http://www.php.net/manual/en/book.soap.php
; The SOAP extension can be used to write SOAP Servers and Clients. It supports subsets of » SOAP 1.1, » SOAP 1.2 and » WSDL 1.1 specifications. 
;extension=php_soap.dll

; http://www.php.net/manual/en/book.sockets.php
; The socket extension implements a low-level interface to the socket communication functions based on the popular BSD sockets, providing the possibility to act as a socket 
; server as well as a client.
;
; For a more generic client-side socket interface, see stream_socket_client(), stream_socket_server(), fsockopen(), and pfsockopen().
; 
; When using these functions, it is important to remember that while many of them have identical names to their C counterparts, they often have different declarations. Please 
; be sure to read the descriptions to avoid confusion.
; 
; Those unfamiliar with socket programming can find a lot of useful material in the appropriate Unix man pages, and there is a great deal of tutorial information on socket 
; programming in C on the web, much of which can be applied, with slight modifications, to socket programming in PHP. The » Unix Socket FAQ might be a good start. 
;extension=php_sockets.dll

; http://php.net/manual/en/sqlite.installation.php
; As of PHP 5 this extension is enabled by default, so simply do not disable it and it'll be available.
; Caution
; Do not use the PECL version of this extension, as it is unmaintained. Always use the SQLite extension that comes with the PHP sources even while compiling as shared. In 
; this case the sources are in php-src-dir/ext/sqlite and the phpize method of building applies.
; 
; Windows users must enable php_sqlite.dll inside of php.ini in order to use these functions. A DLL for this PECL extension is currently unavailable. See also the building 
; on Windows section.
; 
; Windows builds must also enable PDO because as of PHP 5.1.0 it depends on it. So, php.ini will end up with something like this:
; 
; extension=php_pdo.dll
; extension=php_sqlite.dll
; 
; On Linux or Unix operating systems, if you build PDO as a shared extension, you must build SQLite as a shared extension using the --with-sqlite=shared configure option.
; 
; The PHP 5.0.x series of Windows builds enabled this extension by default, where no DLL file is necessary.
; 
; SQLite 3 is supported through PDO SQLite.
; 
;     Note: Windows installation for unprivileged accounts
; 
;     On Windows operating systems, unprivileged accounts don't have the TMP environment variable set by default. This will make sqlite create temporary files in the windows 
; directory, which is not desirable. So, you should set the TMP environment variable for the web server or the user account the web server is running under. If Apache is your
; web server, you can accomplish this via a SetEnv directive in your httpd.conf file. For example:
; 
;     SetEnv TMP c:/temp
; 
;     If you are unable to establish this setting at the server level, you can implement the setting in your script:
;     
;     The setting must refer to a directory that the web server has permission to create files in and subsequently write to and delete the files it created. Otherwise, you may receive the following error message: malformed database schema - unable to open a temporary database file for storing temporary tables 
;extension=php_sqlite.dll

; http://php.net/manual/en/book.sqlite3.php
; Support for SQLite version 3 databases
;extension=php_sqlite3.dll

; http://www.php.net/manual/en/book.sybase.php
; Requires: Sybase client libraries
;extension=php_sybase_ct.dll

; http://php.net/manual/en/book.tidy.php
; Tidy is a binding for the Tidy HTML clean and repair utility which allows you to not only clean and otherwise manipulate HTML documents, but also traverse the document tree.
;extension=php_tidy.dll

; http://php.net/manual/en/book.xmlrpc.php
; These functions can be used to write XML-RPC servers and clients. You can find more information about XML-RPC at » http://www.xmlrpc.com/, and more documentation on this 
; extension and its functions at » http://xmlrpc-epi.sourceforge.net/.
; Warning
; This extension is EXPERIMENTAL. The behaviour of this extension including the names of its functions and any other documentation surrounding this extension may change 
; without notice in a future release of PHP. This extension should be used at your own risk.
;extension=php_xmlrpc.dll

; http://php.net/manual/en/book.xsl.php
; The XSL extension implements the XSL standard, performing » XSLT transformations using the » libxslt library
;extension=php_xsl.dll

; http://www.php.net/manual/en/book.zip.php
; This extension enables you to transparently read or write ZIP compressed archives and the files inside them. 
;extension=php_zip.dll

What do you think?

Name (optional)

Email (optional)

Your comment (optional, but helpful)