Skip to content

Instantly share code, notes, and snippets.

@viniciusbig
Forked from nissicreative/dreamhost-php.md
Created August 9, 2018 01:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viniciusbig/57ccd81f6071c116afbb32cafe27000a to your computer and use it in GitHub Desktop.
Save viniciusbig/57ccd81f6071c116afbb32cafe27000a 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