Customized PHP 5--compelling reasons?

software development

#1

Hi, all,

I’m one of the many folks who understands a little about the big picture of Web programming but who can’t claim any real programming skills. So I can often identify some objective and toss around the relevant terms, but it’s rare that I can pull off anything halfway complicated. A cruel life, indeed.

Case in point: I’d like to add OpenID support to my DreamHost-hosted, WordPress-based site with a plugin from Alan Castonguay. The plugin depends on a PHP library from JanRain, which in turn depends on GMP or BCMath support in the PHP install. But the normal DreamHost PHP5 install does not support GMP or BCMath.

I understand that it’s entirely possible to custom-compile PHP5 for our domains, but it appears to be prohibitively complicated for this dunce. So I’m trying to determine whether to press on or to explore some other option (like simply waiting for a release of the JanRain library without the dependencies–but that could be a long time). Hence this post.

Give me a reason to soldier on. What other capabilities/functionality could a custom PHP5 offer? What libraries do you really wish DreamHost would add to its normal version?

The idea of greater flexibility has a strong general appeal, but some specifics (apart from the OpenID support) could easily persuade me to keep the dream alive…

Many thanks. :slight_smile:


#2

I have set it up for mine for the following reasons:

  • Increased memory max_size
  • Increased the maximum time a script can process from 30 to 60 seconds (important for some DB intensive functions)
  • Larger uploads
  • Can customize it for various other optimizations.
  • The ability to truly utilize php.ini as it is to enable/disable functions such as LaTeX support.

Overall, I’m satisfied with how I’ve set mine up. I used a a script to assist in the build process found at http://wiki.dreamhost.com/index.php/PHP5_installscript - I just customized it a bit, added certain flags needed for the modules I wanted compiled in. Then I put the php.cgi into a separate folder, symlink the php.ini (since I use one basic php.ini for all my uses), and loaded into that directory a template .htaccess file named _.htaccess.

Contents of my _.htaccess file:

AddHandler php5 .php
Action php5 /cgi-bin/php.cgi

Then all you need to do is in the root directory of your domain use ‘ln -s $HOME/php5 ./cgi-bin’ to symlink the php.cgi into your site;
then type ‘cp ./cgi-bin/_.htaccess ./.htaccess’ to copy the htaccess template into the webroot, and your ready to go. This protects it from any accidental deletions, enables the build once, use many times philosophy, and keeps things neat.


#3

Thanks very much for your input, grymwulf. It’ll take me a little bit to chew on it all properly, but chew I will.

Who else would like to add to the menu?