48慈眼 *Reloaded*

Setting Up PHP5.4/Composer Application on Windows With #Chocolatey

07 Oct 2011

I liked Chocolatey concept which had been talked at HN two weeks ago: “Kinda like apt-get, but for Windows”. But how much is it useful actually?

Let’s see it by getting PHP5.4 application work on Windows environment.

Setting Up PHP5.4 On Windows

  • Download zipped PHP 5.4.XX binary
  • Unzip them and rename the folder(assuming “C:\php54” is the folder name)
  • Rename “C:\php54\php.ini-development” to “C:\php54\php.ini”

And lastly, edit C:\php54\php.ini and make following two extensions enable by trimming semicolon:

extension=php_curl.dll
extension=php_openssl.dll

Don’t forget to set the PATH system variable from system settings. For example:

...;C:\php54;

Getting Chocolatey And Composer Ready

Hit the command to get chocolatey ready:

C:\> @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin

Install curl, git and svn commands with chocolatey, as applications available on Composer often depend on them.

C:\> cinst curl
C:\> cinst git
C:\> cinst svn

Here You Go

This is just an example to install BEAR.Package. See the official wiki if you need more detailed instruction.

C:\tmp> curl -s http://getcomposer.org/installer | php
C:\tmp> php composer.phar create-project -s dev --dev bear/package ./bear
C:\tmp> php .\bear\apps\Helloworld\public\min.php
HelloWorld!

Note

At this moment(Feb 17th, 2013), Installing PHP5.4 via cinst failed due to 404 error:

C:\> cinst curl php5-dev

Either cinst or php5-dev seems not maintainanced very well. I already commented this to the owner page of php5-dev.

Related Posts

Mock Object in PHPUnit ROCKS

RubyConf 2016

Bytecode cache is experimentally released in Ruby2.3

 

about me

@remore is a software engineer, weekend contrabassist, and occasional public speaker. Read more