Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#278264 - 26/03/2006 16:00 Compile own PHP on Dreamhost - help?
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
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=2538

I 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.3F

Any 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.
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top
#278265 - 26/03/2006 21:48 Re: Compile own PHP on Dreamhost - help? [Re: hybrid8]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
The first error means that it isn't even getting as far as printing out the "Content-type" and other HTTP headers. That usually means that it's crashing before it gets anywhere. Are you sure that the PHP you compiled runs properly? You can run it from the command line to see.

The second error is probably just that it tried to find an HTML file for the error besides the one compiled into Apache. Almost definitely not anything that has any bearing on your initial problem.
_________________________
Bitt Faulk

Top
#278266 - 27/03/2006 02:37 Re: Compile own PHP on Dreamhost - help? [Re: wfaulk]
hybrid8
carpal tunnel

Registered: 12/11/2001
Posts: 7738
Loc: Toronto, CANADA
It looks like it compiled properly. It runs a test script from the command line without a problem.

Bruno
_________________________
Bruno
Twisted Melon : Fine Mac OS Software

Top