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
the-php-login-project

How to install php-login-one-file on Ubuntu 12.04 LTS

This tutorial will show you how to install the one-file version of php-login.net‘s login script (see the full GitHub repository

“Fuck you. Pay Me.” How to deal with clients, the professional way. An excellent talk with Mike Monteiro.

Excellent (and very useful) speech by Mike Monteiro about how to deal with clients, how to create a professional relation

How Instagram.com works

(Links) How to fix an extremely slow Symfony inside a Vagrant box

When you work with Vagrant (if not – try it!) on a Windows or Mac machine (which is an excellent

php

How to setup / install PHP 5.6 on Ubuntu 14.04 LTS

Ubuntu 14.04 LTS ships with PHP 5.5 by default, but if you want to use PHP 5.6, then it’s just

MINI2, an extremely simple barebone PHP application on top of Slim

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

php

[Link] How to create, read, update and delete (CRUD) with PDO, MySQLi and MySQL the right way (prepared statements)

Mike Dalisay has written an excellent tutorial on the CORRECT USAGE of basic CRUD functions (create, read, update, delete) with

goodbye-lamp-going-hhvm-nosql-nginx-php

[RePost] Goodbye LAMP: Going Nginx, NoSQL, HHVM (41min conference talk with Arne Blankerts)

Another excellent find by Germany’s PHP Magazin in the article “Nginx, NoSQL, HHVM: Goodbye LAMP Stack?“: 41 minutes super-interesting (english)

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.

php

How to install/setup latest version of PHP 5.5 on Debian Wheezy 7.0/7.1/7.2 (and how to fix the GPG key error)

Please note: This works fine. But this package will also upgrade your apache to version 2.4 which has different config

1/4

Categories

Search

The New Era of JavaScript (28min conference talk, Jack Franklin, 2013)
shadow dom
A quick video introduction into Shadow-DOM, the game-changing DOM-subtree-technology
sass laravel
SASSmeister is a real-time JSfiddle for SASS / CSS. Awesome!
php
[Link] Excellent PHP best practices, 2014 style
anti block adblock
Show ads to ad-blockering visitors – with PageFair.com
Stressed and unrelaxed while coding ? Try some ultra-deeply-relaxing ASMR audio clips. It will change your life. Seriously.
All new features of WordPress 3.9 in this 2 minute video
A collection of beautiful ajax loaders / spinners in pure .svg / CSS
How to fix the ugly font rendering in Google Chrome
How major web companies (and banks) handle passwords quite wrong
DigitalOcean coupon voucher 50
Only today: $50 coupon for DigitalOcean SSD VPS / hosting
hack-php
Facebook releases HipHop (HHVM) 3.0, adds mysqli and support for Hack language
zend framework 3
First view on Zend Framework 3 by Matthew O’Phinney
pdo-debug
Debug PDO with this one-line function. Yeah!
php
12 tools for better PHP quality

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