PHP (= Hypertext Preprocessor) is an HTML-embedded server-side scripting language.

PHP is distributed at no charge for commercial or non-commercial use. For more information read the LICENSE information.

More information about PHP can be found at:

PHP manuals can be found at:

The latest PHP version can be downloaded from:

Installing PHP5.4.15 (thread safe) on Apache 2.2.11


Operating system used
Windows Vista Home Premium SP 2

Software prerequisites
Apache 2.2.11

  1. Download and unzip (VC9 x86 Thread Safe):
    e.g.: c:\tools\php-5.4.15-Win32-thread-safe

  2. Set System environment variable: PATH:..;c:\tools\php-5.4.15-Win32-thread-safe

    This is optional. Only required if you want to enter php commands in a terminal.

  3. Copy file c:\tools\php-5.4.15-Win32-thread-safe\php.ini-production

  4. Edit file c:\WINDOWS\php.ini, change the following line:

    error_reporting = E_ALL
    post_max_size = 8M
    doc_root = C:\mobilefish_web
    extension_dir = "c:\tools\php-5.4.15-Win32-thread-safe\ext"
    upload_max_filesize = 2M

  5. Configure Apache by editing C:\Program Files\Apache Software Foundation\Apache2.2\conf\httpd.conf:

    • Enable module to allow output from your server to be compressed before being sent to the client over the network:
      LoadModule deflate_module modules/

    • Enable module to control and modify HTTP request and response headers:
      LoadModule headers_module modules/

    • In this example PHP will be run as a module in Apache and not as a CGI library.
      Add the following line after all the LoadModule statements:
      LoadModule php5_module "c:/tools/php-5.4.15-Win32-thread-safe/php5apache2_2.dll"

    • Add index.php in the DirectoryIndex directive:
      DirectoryIndex index.html index.shtm index.htm index.php

    • Add the following line after all the AddType statements:
      AddType application/x-httpd-php .php

    View the updated httpd.conf file.

  6. Restart Apache.

  7. To test the PHP installation, create a file phpinfo.php with the following line:

    <?php phpinfo(); ?>

    Save this file into your Apache htdocs directory, e.g.: C:\mobilefish_web and type:

    You should see something like this: