Skip to content

Instantly share code, notes, and snippets.

@damashe
Forked from nissicreative/dreamhost-php.md
Created November 16, 2017 04:54
Show Gist options
  • Save damashe/8f9ccab2fdb458265e377f23a4b4f1df to your computer and use it in GitHub Desktop.
Save damashe/8f9ccab2fdb458265e377f23a4b4f1df to your computer and use it in GitHub Desktop.
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 = phar.so
extension = fileinfo.so
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 https://getcomposer.org/installer | 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