Dreamhost – Installing Composer

Composer is a dependency manager for PHP.

Similar to nodes NPM and Python’s “pip” dependency manager, Composer handles the installation of any third party module included within composer.json.

First check your PHP version by running the following command


// get version
php -v

// should give you the following result or similar

PHP 5.6.36 (cli) (built: Apr 30 2018 20:24:54) 
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies


cd ~/

vi .bash_profile

// in .bash_profile insert the following
export PATH=/usr/local/php56/bin:$PATH


The phprc file

Find your PHP version and insert the following the following snippet of code.


cd ~/.php

vi 5.6/phprc

// insert into phprc
extension = phar.so
suhosin.executor.include.whitelist = phar

Now you can run the following command:


php composer.phar <command>

Written by Alex Mercer

Alex Mercer is a writer and contributor at Project Immerse, covering web design, WordPress, web development, SEO, digital strategy, emerging technology, and the evolving world of the web. His work focuses on practical ideas, useful tools, and approachable guidance that help creators, developers, and business owners build better digital experiences.

Alex writes with a hands-on, curiosity-driven approach, exploring both established web practices and new technologies shaping how websites are designed, built, and discovered.