Saturday, November 8, 2014

Install PHP 5.6 on Win 8.1 x64

Install PHP 5.6 on Win 8.1 x64


Following the instructions here http://windows.php.net/download/

I downloaded the VC11 x86 Thread Safe (32-bit), even though I'm on 64-bit Win 8.1

The 64-bit is experimental and oh well, I don't need PHP to do super crazy number crunching anyway.

Installation instructions

  • Create dir C:\dev\php
  • Extract the zip contents into that directory
  • Add C:\dev\php to the system environment path
  • copy C:\dev\php\php.ini-development to C:\dev\php\php.ini

Set Time Zone

  • edit C:\dev\php\php.ini
  • Add this line:
    date.timezone = America/Los_Angeles

Change the time zone to match whatever yours is.  This example works for PST in the US.  To see all supported time zones go to http://php.net/manual/en/timezones.php

Get SSL working:

  • edit C:\dev\php\php.ini
  • Uncomment this line:
    ;extension=php_openssl.dll
  • And change the line to read this:
    extension=C:\dev\php\ext\php_openssl.dll

Enable CURL:

  • edit C:\dev\php\php.ini
  • Uncomment this line:
    ;extension=php_curl.dll
  • And change the line to read this:
    extension=C:\dev\php\ext\php_curl.dll

Enable XSL (for PHPDoc):

  • edit C:\dev\php\php.ini
  • Uncomment this line:
    ;extension=php_xsl.dll
  • And change the line to read this:
    extension=C:\dev\php\ext\php_xsl.dll

Install XDebug:

  • Download from here:
    http://xdebug.org/download.php
    • Make sure you pick the one that matches the version of PHP you installed.
    • For example I got "PHP 5.6 VC11 TS (32 bit)"
  • Windows will tell you this type of file is not safe.  Duh.  Save it anyway
    • Save it to C:\dev\php\ext
  • edit C:\dev\php\php.ini
    • THIS IS NOT AN ORDINARY EXTENSION
    • Add it by adding this line at the bottom:
      zend_extension="C:\dev\php\ext\php_xdebug-2.2.5-5.6-vc11.dll"
    • Of course make sure the filename matches the one you downloaded.

Install Composer


Download Composer, it should work fine now:

Thanks to:

http://php.net/manual/en/openssl.installation.php Alan 3 years ago added some great tips on how to do this very thing.