Skip to content

Instantly share code, notes, and snippets.

Last active September 1, 2020 14:05
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Update PHP and install Composer on DreamHost

DreamHost PHP

Make PHP 7 default binary for CLI

ssh <server>
# ~/.bash_profile
export PATH=/usr/local/php70/bin:$PATH
source .bash_profile

Confim PHP CLI version:

php -v

Update .bashrc

# .bashrc
source .bash_profile

Create phprc file

mkdir -p ~/.php/7.0 && cd ~/.php/7.0
nano phprc

Enable phar and fileinfo extensions:

# phprc

extension =
extension =
suhosin.executor.include.whitelist = phar

memory_limit = 512M
upload_max_filesize = 100M
post_max_size = 105M
max_execution_time = 500
max_input_time = 500

Confim Phar:

php -m | grep Phar

Install Composer

mkdir -p ~/.php/composer
cd ~/.php/composer
curl -sS | php

# Rename executable
mv ~/.php/composer/composer.phar ~/.php/composer/composer

Add composer to $PATH:

# .bash_profile
export PATH=~/.php/composer:$PATH
source ~/.bash_profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment