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

Support FLARUM, the future of PHP forum scripts (with some dollars on Kickstarter)

PHP forum scripts are horrible, let’s face it. Nearly everything that’s available is hard to install, hard to handle, hard

vagrant

A super-simple Vagrant LAMP stack bootstrap (installable with one command)

As I have to setup servers inside Vagrant quite often, sometimes 10 times per day, I started to use provisioning:

the-php-login-project

How to install php-login-minimal on Ubuntu 12.04 LTS

In this article I’ll show you how to install the minimal version of the php-login.net‘s login script (see the GitHub

github-logo-octocat

GitHub rolls out .PSD diff and viewing

Good news for frontend designers / developers working with Photoshop a lot: GitHub has just rolled out native .psd support:

php

PHP.net hacked, but most things are fine again

Between 22nd and 24th October 2013 php.net served JavaScript malware (that was built to use security holes in the usually

PHPStorm: 42 Tips and Tricks (47min video talk by Mikhail Vink at Dutch PHP Conference 2015)

To be honest I’ve not seen the clip yet, but it sounds so awesome and everybody is upvoting it. Have

october cms

October CMS, built on top of Laravel, is beautiful, clever and on the way to be the new #1 CMS

Do you remember when you tried to edit one line of code inside TYPO3 or Contao ? And the extreme

unreal-4-engine

Tim Sweeney talks about the future of game graphics (and which hardware we need to “clone” reality)

If you are interested in 3D/CAD and game graphics and get sweaty hands at each new high-end game engine trailer

redaktionelle-hochlastseiten

Hochlastseiten mit PHP, MySQL und Apache am Beispiel stern.de (deutscher Artikel)

Eine grandiose Powerpoint-Präsentation die sich jeder, der mit PHP, MySQL und Apache auf Linux arbeitet, mal anschauen sollte: Nils Langner,

hiphop php

Vote for “Hack” for HipHop/HHMV support (future style PHP) in PHPStorm 8

“Hack” will come. And “Hack” will change PHP, definitly. In case you never heard of it, have a look into

1/4

Categories

Search

php uk conference
PHP Caching Best Practices by Eli White (video from PHP UK Conference 2014)
Creators of Laravel launch one-click-installations of Laravel (including nginx, PHP 5.5 etc.)
cheap cloud server php
DigitalOcean rolls out interesting feature: Transfering server snapshots directly to the client’s account
php
How to use the PHP 5.5 password hashing functions
[Link] Making a website vertically responsive
october cms
[Link] How To Install October CMS on a VPS running Ubuntu 14.04
Frontend Ops Conf 2014 – Paul Irish: Delivering The Goods In Under 1000ms (40min video)
The New Era of JavaScript (28min conference talk, Jack Franklin, 2013)
Frontend Ops Conf 2014 – Sarah Goff-Dupont: Git, Continuous Integration and Making It Pretty (31min video)
css3-chrome-font
[Link] Retinafy your Site / Device by Nijiko Yonskai
php
appserver.io – A New Way of Magento Enterprise Infrastructure (26min video talk)
Frontend Ops Conf 2014 – Rebooting Flickr On A Node.js Stack, One Page At A Time (from PHP) by Bertrand Fan
battlefield-3-free
Electronic Arts / Origin offers Battlefield 3 for free (limited promo action) !
Hacked french TV channel exposed passwords in TV interview (video, screenshots, links)
github-logo-octocat
GitHub rolls out .PSD diff and viewing

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