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.

Wednesday, September 17, 2014

Configure MinGW-W64+MSYS to use PuTTY Plink/Pageant

Configure MinGW-W64+MSYS to use PuTTY Plink/Pageant

I forgot to document this last time so I figured I'd post to save anybody the trouble of figuring out how to do it again.

Install Putty/Pageant/Plink


For purposes of this document we assume you installed Pageant into:

C:\tools\PuTTY\pageant.exe

Load SSH keys into Pageant


Start Pageant and load in your SSH keys.  (Quick explanation here).

Configure Windows System Environment Variables


Windows key => "Environ" => Edit the system environment variables => [Environment Variables...]

Look in System variables, modify these if they exist, otherwise add them:

GIT_SSH = "C:\tools\PuTTY\plink.exe"
SVN_SSH = "C:\tools\PuTTY\plink.exe"

Click [OK]

Open new MinTTY (or other MSYS terminal)


Close any MSYS terminal or MinTTY that you have open, and open a new one.

Confirm that everything should be working:

bash$ env | grep -i ssh
GIT_SSH=C:\tools\PuTTY\plink.exe
SVN_SSH=C:\tools\PuTTY\plink.exe

Use PuTTY to connect to the host you want to access


For each new host you must use PuTTY to connect.  This is especially important when you are using git or svn or something that doesn't directly access ssh.  If you haven't yet connected to that host with PuTTY, the connection will probably fail.

Example first Github clone


PuTTY => New Session

  Hostname: github.com
  Click [Open]

You'll get a message from Pageant, do you want to save this key?  Click [Yes]

Now you should be good to go,  you can close the PuTTY window, and go back into MinTTY and try to git clone.

$ git clone git@github.com:joyent/node
Cloning into 'node'...

Obviously you should clone a repository to which you have access.  Everything should work.

Monday, September 15, 2014

Strawberry Perl on MinGW-W64 + MSYS

Strawberry Perl on MinGW-W64 + MSYS

Following up to my bare bones MinGW-W64 + MSYS install, I've found it to be convenient to install a version of Perl that you can actually keep updated easily.  The Perl version that comes with MSYS is really old.

Install Strawberry Perl

I'm using Strawberry Perl from http://strawberryperl.com

Download and install it.  I installed to C:\perl

Modify $PATH via ~/.bashrc

Add the following code to your ~/.bashrc assuming you installed to C:\perl

# Force Strawberry Perl to the front of the path
if [ -x /c/perl/perl/bin/perl.exe ]; then
export PATH="/c/perl/perl/bin:$PATH"
fi


Exit your shell and start a new shell.

Make sure it worked

ross@win$ which perl
/c/perl/perl/bin/perl.exe

Success!  Enjoy your modern Perl.

Saturday, May 17, 2014

Review: 2014 Razer Blade 14"

So my new 14” Razer Blade arrived a few days ago and I’m really enjoying it.

All in all, it’s a very nice machine.  The screen, when looking at apps that work for high DPI, and/or looking at pics/video that actually use the entire resolution (very hard to find) looks AMAZING.

Some games I installed actually support the insane 3200 x 1800 resolution, and WOW they look just incredible.  The graphics card in this machine doesn’t act like a laptop graphics card, it is VERY GOOD.

There are some caveats.

  1. The screen resolution is SO HIGH and the screen itself is only 14” so the DPI is VERY VERY high.  It’s so high that many Windows apps aren’t yet prepared to handle it, and when you see them on the screen, they are the size of a proverbial quarter.
    1. There are ways to get around this with each app, which involves configuring Windows to launch these apps in compatibility mode, but it requires work.
    2. There is also a “Magnifier” app to let you zoom in, but that is annoying to use.
  2. It’s on significant back-order.  It took 2 months for mine to arrive.  My buddy ordered one at the same time and he was just informed that his delivery got pushed back at least 1 more month.

RE Windows 8.1

  1. It’s not as scary as people made it out to be.  They sort of added back the concept of the start button, and the vast majority of stuff I do is in desktop mode which works well.
  2. My primary browser is Chrome, and it doesn’t work great at this high DPI.  It looks like shit really, and it only works in compatibility mode at the moment.  Google is aware of the issue and supposedly working to fix it, but who knows how long that will really take.  IE looks great, but it’s IE, which is notorious for its insecurity and so I refuse to use it except to download Chrome.

My only real complaints:

  1. After getting used to the Track Pad on the MacBook Pro, I think every other track pad is going to piss me off.  This one is no exception.
    1. It isn’t as sensitive as the MacBook Pro
    2. It doesn’t support single-finger-click without picking your finger up and tapping it back down; that is one of my favorite features of the MacBook Pro track pad.
    3. The left/right mouse click buttons are so close to the edge of the device that it’s challenging to use them when I’m sitting on the couch and actually using the device as, you know, a laptop.
      1. Not an issue when sitting at the desk, which is mostly what I do.
  2. Managing all the DPI settings for every app I install is annoying.
    1. However you really only have to do this once, when you install, and then it’s done.
    2. Also going forward more and more apps will have high DPI support that actually works.
      1. Mac went through this same thing when they released high DPI Retina display.  This display is even HIGHER DPI than that though, and so the problem is even worse in this case.
    3. In the long-run this won’t be an issue, but today it is.
  3. 8 GB RAM limit
    1. So far I haven't hit the limit, even though I've been running VMs and my IDEs simultaneously, but then again I haven't really been working with huge DBs etc that require a ton of RAM.  I expect 16 GB in a laptop these days, so the 8 GB limit makes me nervous.  I'd have put 32 in here if that had been an option.

Not sure I’ll really use the touch screen all that much, but my daughter loves it.  She hates the idea of a mouse, she’s so used to her iPad, iPhone, Android Phone.  Things should work when you touch them as far as she is concerned.  She likes surfing YouTube and Vube on my laptop now, which she refused to do on my previous laptops as they had no touch screen.

All in all, excellent job Razer!

This is a VERY SMALL laptop that I can easily travel with, and I haven't had to compromise on performance to get it.  It looks and feels amazing and it's a pleasure to work on it.