I'm having trouble getting a PHP installation/build to work within my space on Dreamhost. Can anyone help figure this out? Here's a message just sent to the Dreamhost support staff. They mention in a KB that you can install your own PHP if their default does not contain all the modules you require. We've asked them to add bcmath but they didn't know when their next compile would be nor if our request would make it in. I can't afford to wait to find out.
Hi, I am trying to run a PHP script that requires the bcmath extension
which your default 4.4.2 installation does not contain. I found the
following knowledge base article on creating your own custom PHP
installation:
http://blog.dreamhosters.com/kbase/index.cgi?area=2538I compiled 4.4.2 from php.net. For configuration, I first did a
phpinfo() to get your current configuration and then tagged on
--enable-bcmath at the end:
'./configure' '--with-mysql=/usr' '--enable-calendar'
'--enable-force-cgi-redirect' '--with-config-file-path=/etc/php/cgi'
'--enable-trans-sid' '--with-gd' '--with-ttf=/usr'
'--with-freetype-dir=/usr' '--with-exif' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr' '--with-zlib-dir=/usr' '--enable-ftp'
'--with-curl=/usr' '--with-mcrypt=/usr' '--with-pspell=/usr'
'--enable-xslt' '--with-dom-xslt=/usr' '--with-dom=/usr'
'--with-xslt-sablot=/usr' '--with-openssl=/usr'
'--enable-mbstring=all' '--with-gettext' '--enable-bcmath'
I put the executable (renamed as php.cgi) into a cgi-bin directory in
my domain directory (/home/hybrid8/twistedmelon.com/cgi-bin) and
created an .htaccess file in the twistedmelon.com directory:
AddHandler custom-php .php .pcgi
Action custom-php /cgi-bin/php.cgi
Permissions are:
.htaccess 644
cgi-bin 755
php.cgi 755
I created a test script that just does phpinfo(). When I invoke it
(www.twistedmelon.com/info.php), I get an internal server error 500.
Checking the http error log gives me:
[Sun Mar 26 09:14:22 2006] [error] [client 69.198.115.118] Premature
end of script headers: /home/hybrid8/twistedmelon.com/cgi-bin/php.cgi
[Sun Mar 26 09:14:22 2006] [error] [client 69.198.115.118] File does
not exist: /home/hybrid8/twistedmelon.com/internal_error.html
Given that the script works fine if I don't use my version of php (ie
if I get rid of the .htaccess and use your default php installation),
the logical assumption is that permissions are the problem. However
I've double checked the permisions and I'm fairly certain I have it
set correctly. At this point I'm at a loss for why it's not working.
I also checked here, but still can't figure out what the problem
might be:
http://wiki.dreamhost.com/index.php/KB_/..._my_CGI_work.3FAny ideas? I really need to get PHP bcmath support in order to run
our license generation script, and I'm not sure how else to do this.
Thank you very much for your help.