I love using MediaTemple for my simple sites. When I don't have complex hosting requirements, I know I can get my PHP applications up and running really quickly. Their support is great, their hosting fast and feature-rich and their prices competitive.
...but there's one problem. (gs), their shared hosting platform, has a limited PHP CLI binary. You can't configure it through a php.ini (see this tweet for more). This makes it impossible to use Composer. Since Composer is the future of PHP, this is quite worrying.
There is, however, a solution. We can use the
-d flag to set the runtime config variables required to get Composer running.
curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar
...and then to run composer.phar:
php -d memory_limit=512M -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar composer.phar
This is ugly, so let's clean it up. We'll add an alias to the bash profile:
$ vim ~/.profile
We'll alias get_composer to our install command and composer to our composer.phar file. This way we can set up new subdomains and such easily:
alias get_composer="curl -s https://getcomposer.org/installer | php -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar" alias composer="php -d memory_limit=512M -d allow_url_fopen=1 -d suhosin.executor.include.whitelist=phar composer.phar"
Save, and reload the profile (this will be done automatically next login):
$ source ~/.profile
Now, we can use Composer to our hearts' content:
$ get_composer All settings correct for using Composer Downloading... Composer successfully installed to: /blah/domains/efendibooks.com/composer.phar Use it: php composer.phar $ composer -V Composer version cb2a0f4
Over at Efendi Books, we've been working hard and are thrilled to announce the immediate release of the second Efendi Minibook, Neil Davidson's sensational Don't Just Roll The Dice. Don't Just Roll The Dice is a usefully short guide to software pricing from the CEO of a rather large software company. Its style is wonderful and content invaluable.
It's been given a lick of paint as well as gutted and given a bunch of brand new content. We're very proud of it and can't wait to spread it far and wide! It's available for free from the Efendi Books website.
A few small business / personal things I've learnt over the past few days:
- Don't have a beer at lunchtime. You won't get anything done in the afternoon, even if you try.
- Things always take longer than you'd expect to get done.
- Your best work should only ever be your latest work.
- Never compromise.
- Lying is a linguistic tool, much like lists of three or alliteration, and should be used as such. But be very careful.
- Reality distortion fields do exist, and you can use them to your advantage.
- If you're not focusing at your desk, stop trying. Sit in a café, or in a park, or on a bridge, or something.
- Never take up an offer, no matter how generous, if you've even the slightest reservation or feeling that you may be being rude.
- Get a mentor.
- This isn't the worst day of your life. It's the best day of your life with the most challenges.
An excellent talk from 37signals developer Jamis Buck about what makes people passionate about Ruby. A very interesting chat that made me learn a lot about the language in a very short space of time.
Definitely recommended watching, even if you're not a Ruby person.