Logo
  • PHP
    • HipHop / HHVM
    • Modern PHP
    • PHPStorm
    • LAMP
    • Laravel
    • Composer
    • PDO
  • JavaScript
    • node.js
    • AngularJS
  • CSS
    • SASS
    • “CSS4” (CSS level 4)
  • HTML
  • Git
  • LAMP
  • Vagrant
  • UI / UX
  • Architecture of …
  • Off-Topic
With ♥ from Berlin
December 15, 2013
Chris
Composer, PHP
Comments Off on How to install Composer on Windows 7 / 8 or Ubuntu

How to install Composer on Windows 7 / 8 or Ubuntu

PreviousNext
composer

Installation on Windows 7 / 8

Installing Composer on Windows 7 or 8 is extremely easy: Get the latest version of Composer from getcomposer.org (direct link to .exe here) and install it. You can now use Composer from everywhere on your system (via cmd.exe, PHPStorm or any other tool).

 

Installation on Unixes (Ubuntu, Debian, CentOS, …)

Most tutorials say that you should download the composer.phar file into your project, you’ve probably seen this before. But, this is outdated and not recommend! The better way to go is to “install” Composer. It’s also not possible to use Composer out-of-the-box, as this tool uses some things that need to be installed first: Composer is basically a PHP tool (which runs PHP on a webserver) that fetches remote files via git and curl over https (=openssl!). All tutorials I’ve ever seen totally miss these points. Installing Composer on linux needs a little bit of work first:

Do an update:

sudo apt-get update

First, make sure you have curl installed, so simply try to install it (if already installed, nothing will happen). Curl is a basic unix tool for file transfering (wikipedia). Install curl and the php5-curl extension:

sudo apt-get install curl
sudo apt-get install php5-curl

Then, make sure you have OpenSSL installed, a library that allows unix to handle HTTPS. A little notice on the Hearthbleed Bug that affected OpenSSL: Afaik this installs fixed/patched versions of OpenSSL, but I’m not 100% sure. Same procedure as with curl:

sudo apt-get install openssl

As Composer uses git, we also need to have git on the system:

sudo apt-get install git

Restart your server (will work without, but it’s always better to restart the Apache, otherwise PHP will say curl is not installed):

sudo service apache2 restart

Okay, now let’s install Composer:

curl -sS https://getcomposer.org/installer | php
sudo mv composer.phar /usr/local/bin/composer

This downloads composer.phar (which is a packed php archive by the way, see http://php.net/phar for more info) moved the file to a special folder, making it available systemwide.

Now you can use composer everywhere on your server on the command line via

composer

Type the above comamnd to make sure Composer is installed correctly. You’ll see something like this:

composer-install

Please note: A lot of tutorials show composer commands like that:

php composer.phar

That’s not necessary anymore as we have “installed” Composer. A single composer command followed by the arguments is all you need.

[wp_ad_camp_2]

Update Composer (on Windows 7/8 or Unixes)

Updating Composer itself is a one-line command, you can do this from anywhere in the system:

composer self-update

 

Have fun with Composer! It will change the way you work with PHP forever! To get into the basics of this tool, have a look into this article: Getting started with Composer.

composerPHP
Share this

Going node.js at Netflix (Slides by Micah R of Netflix)

It’s awesome how node.js takes over the absolute AAA-level corporate world. Note that node.js is still an early alpha product

photoshop-cc-deal

Adobe offers Photoshop for $9.99 per month (limited deal)

Currently Adobe offers the very latest version of Photoshop (which is Photoshop CC) for just $9.99 or 12,99€ (EU zone:

html6

Is this the first HTML6 specification?

  I just found this very interesting “project” including an active, but unpopular GitHub repo: http://html6spec.com/ https://github.com/OscarGodson/HTML6 Looks like these

times-new-roman

The Times talks about Times New Roman (3min video)

A sweet little video, made by The Times, about Times New Roman. No real information here, but nice to look.

Compare 250+ cloud server plans with Cloud Cost Calculator

How cool is that ? The Cloud Cost Calculator compares more than 250 cloud server plans of Amazon, Rackspace, DigitalOcean,

logo-internet-explorer

How to professionally test on old Internet Explorer versions

If you have (or want) to test your websites and applications on older versions of Internet Explorer, then there’s a

MINI, an extremely simple barebone PHP application

For my daily work I often needed to setup super-simple PHP applications, just some more or less static pages plus

hiphop php

HipHop VM reaches 100% green Unit Tests in Laravel, Drupal, Slim, CodeIgniter etc.

In September 2013 the PHP HipHop VM dev team wrote a very interesting article [1] about failing Unit Tests of

php

A super-simple introduction into PHP namespaces (7min video)

Once again, Jesse of JREAM totally nails it right on the head. A super-simple introduction into PHP namespaces. If you

ubuntu-14.04-lts

First view: Ubuntu 14.04 LTS brings PHP 5.5 and Apache 2.4

Short first view on Ubuntu 14.04 LTS (= long term service): I just tried out the alpha1 version of the

1/4

Categories

Search

organizing css
Jonathan Snook – CSS is a Mess – How to organize CSS in big projects (54min video talk)
mod-rewrite-ubuntu-14-04-lts
EOL lists of Ubuntu, Debian and CentOS for your server plannings
digitalocean coupon
Free $10 coupon for DigitalOcean SSD cloud VPS hosting
php
New GitHub repo: simple php-long-polling for creating real-time apps
html6
Is this the first HTML6 specification?
php
PHP 5.7 gets refactored core, is 10%-30% faster than PHP 5.5! Wow!
battlefield-3-free
Electronic Arts / Origin offers Battlefield 3 for free (limited promo action) !
phpstorm 7.0 php
A perfect video tutorial to get started with xdebug in PHPStorm
Frontend Ops Conf 2014 – Keynote by Alex Sexton: “Front End Operations”
Adobe releases Firebug-like developer tools to edit and extract PSDs
php
[Link] How to create, read, update and delete (CRUD) with PDO, MySQLi and MySQL the right way (prepared statements)
php mvc
Preview-release of (my) “php-mvc” project (a simple php mvc barebone)
Useful basic linux stuff: Show kernel version, distribution name and distribution version on Ubuntu systems
How to show memory usage (Ubuntu)
goodbye-lamp-going-hhvm-nosql-nginx-php
[RePost] Goodbye LAMP: Going Nginx, NoSQL, HHVM (41min conference talk with Arne Blankerts)

Tags

apache bash centos composer conference coupon CSS debian fonts framework git GitHub hack HHVM HipHop HTML HTML5 IDE JavaScript JS LAMP laravel linux mod_rewrite MVC MySQL Nginx optimization PHP PHP 5.5 PHP 5.6 phpmyadmin PHPStorm security server SSD Ubuntu UI UX vagrant video virtual machine voucher VPS wordpress
Side-Project: Wordle-Solver:
www.wordle-helper.info

Pages

  • Privacy Policy