Friday, April 17, 2009

Install PHP 5.2.9-2 (Windows)

I have already had Apache 2.2 installed.

  • Download php-5.2.9-2-Win32.zip. Extract it to C:/free/php

  • Make a copy of php.ini-dist and rename it to php.ini

  • Add the following text to C:/free/Apache2.2/conf/httpd.conf


    • #load the php main library to avoid dll hell
      Loadfile "C:/free/php/php5ts.dll"

      #load the sapi so that apache can use php
      LoadModule php5_module "C:/free/php/php5apache2_2.dll"

      #set the php.ini location so that you don't have to waste time guessing where it is
      PHPIniDir "C:/free/php"

      #Hook the php file extensions, notice that Addtype is NOT USED, since that's just stupid
      AddHandler application/x-httpd-php .php
      AddHandler application/x-httpd-php-source .phps

No comments: