So you have an old Dreamhost hosting account that’s been sitting around for a few years and you need to put some fancy new web tech on it via SSH. Perhaps you want to install Laravel! If only there was an article that could get you up and running with Laravel!
Laravel requires PHP 5.4. Once you are SSH’d into your account you should run a php -v
to see what version you have. I was actually running 5.2. Not good.
For your Dreamhost account, your PHP installations are located at /usr/local/
. For my particular server, I had /php5
, /php53
, and /php54
. In order for the latest version of PHP to run when I use the php
command, I will need to map the alias via alias php='/usr/local/php54/bin/php'.
For my scenario, I was actually trying to get Laravel 4 up and running and not only was my php
alias out of date, but I was missing the phar extension required by Composer. To remedy this in Dreamhost, you need to create ~/.php/5.4/phprc
file and put the line extension = phar.so
. To verify what extensions/modules are loaded, you can do php -m
to see a list.
Note: This post covers upgrading the php version that is used when you are logged into your Dreamhost account via SSH. To change the version that your server actually runs, you would go to Manage Account , scroll down to Domains Hosted and click the Edit button next to the domain you wish to upgrade. You’ll find your available PHP options under Web Options > PHP Mode.