# Compiling php with fcgi on tiger

**URL:** <https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293>\
**Category:** Rails\
**Created:** [March 28, 2006, 7:52pm UTC](https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293 "2006-03-28T19:52:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anne001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@anne001](https://www.ruby-forum.com/u/anne001)\
**Post date:** [March 28, 2006, 7:52pm UTC](https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293/1 "2006-03-28T19:52:12Z")

</div>

I can’t figure out how to compile php with fcg enabled.

I found a website which gives an example of how to write options in  
configure  
[http://scoops.totallyrule.com/articles/2006/02/01/mysql5-ab-package-and-php5](http://scoops.totallyrule.com/articles/2006/02/01/mysql5-ab-package-and-php5)

So I wrote  
./configure --prefix=/usr/local --program-suffix=5 --enable-fastcgi  
–enable-discard-path --enable-force-cgi-redirect  
–with-mysqli=/usr/local/mysql/bin/mysql\_config  
make  
sudo make install

I don’t get any error, but 127.0.0.1/test is still pointing at the  
package  
from  
[http://www.entropy.ch/software/macosx/php/](http://www.entropy.ch/software/macosx/php/) and the apache config file  
has the info from the entropy package.

I think I need to tell make install where to put the directories, and  
then I  
need to comment out the lines entropy entered in httpd.conf and replace  
them  
with some new lines.

Can someone points me to some info on how to do this?

* * *

I have been following this script but there is not enough info for me to  
info for me to follow the php part  
These instructions work on OSX, most linux distros and FreeBSD  
You can skip ruby if you already have a good copy. But if you only have  
the  
stock ruby that comes with OSX I would compile it from source and rename  
the  
stock OSX ruby and irb to ruby.bak and irb.bak so you don’t end up using  
them on accident.

* * *

Get Ruby1.8.2

curl -O [http://rubyforge.org/frs/download.php/2338/ruby-1.8.2.tar.gz](http://rubyforge.org/frs/download.php/2338/ruby-1.8.2.tar.gz)  
tar xvzf ruby-\*  
cd ruby-1.8.2  
./configure  
make  
make test  
sudo make install

* * *

Get Ruby gems

curl -O [http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz](http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz)  
tar xvzf rubygems\*  
cd rubygems\*  
sudo ruby setup.rb

* * *

Get Rails and a few other gems

sudo gem install rails RedCloth search\_generator salted\_login\_generator  
production\_log\_analyzer  
answer yes to all dependencies

* * *

Get mysql-ruby C bindings (the pure ruby ones suck)  
This command works great on osx as well using the mysql 4.1.x installer  
from  
[mysql.com](http://mysql.com)  
or the [serverlogistics.com](http://serverlogistics.com) mysql as well.  
curl -O [http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz](http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz)  
tar zxvf mysql-ruby-\*  
cd mysql-ruby-\*  
ruby extconf.rb --with-mysql-config  
make  
sudo make install

* * *

download fastcgi developers kit

curl -O [http://fastcgi.com/dist/fcgi-2.4.0.tar.gz](http://fastcgi.com/dist/fcgi-2.4.0.tar.gz)  
tar xvzf fcgi-2.4.0.tar.gz  
cd fcgi\*  
./configure  
make  
sudo make install

* * *

Get the new non memory leaking ruby-fastcgi bindings

curl -O [http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz](http://sugi.nemui.org/pub/ruby/fcgi/ruby-fcgi-0.8.6.tar.gz)  
tar xzvf ruby-fcgi\*  
ruby install.rb config --without-ext  
ruby install.rb setup  
sudo ruby install.rb install

* * *

We need the correct pcre .soÃ?â??s for lighttpd to work correctly

curl -O  
ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-5.0.tar.gz  
tar xzvf pcre-5.0.tar.gz  
cd pcre-\*  
./configure  
make  
sudo make install

* * *

Get lighttpd

curl -O [http://www.lighttpd.net/download/lighttpd-1.4.6.tar.gz](http://www.lighttpd.net/download/lighttpd-1.4.6.tar.gz)  
tar xzvf lighttpd-1.4.6.tar.gz  
cd lighttpd-\*  
./configure  
make  
sudo make install

* * *

Compile php as a fast-cgi binary The main thing here is the following  
configure options. You can add whatever else you like to your php binary  
but  
these are needed for fast-cgi support.

$ ./configure   
–enable-fastcgi   
–enable-discard-path   
–enable-force-cgi-redirect \

* * *

Lighttpd Launcher Script

Here is a link for a sweet enhancement. Put this script in your  
RAILS\_ROOT/script folder and put the lighttpd.conf file in  
RAILS\_ROOT/config. Now you can launch your rails app by cdÃ?â??ing into  
your  
RAILS\_ROOT for your app and typing:  
$ruby script/lighty -p 7500 -e development (or whatever port&env you  
want to  
use)

## Now you can hit [http://localhost:7500/](http://localhost:7500/) and you will get your app running on lighttpd no muss no fuss. Very sweet for development. Here is the link: [BigBold - Informasi Tentang Bisnis dan Marketing](http://www.bigbold.com/snippets/posts/show/303) . Name the first ruby script lighty and name the config file lighttpd.conf. Now every time you start your app this way is creates a new lighttpd.conf in /tmp and starts lighttpd up with that file. This way you can give it command line options as to what port to bind to and others. IÃ?â??m using this for development and it is sweet!

View this message in context:  
[http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3634565](http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3634565)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![anne001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@anne001](https://www.ruby-forum.com/u/anne001)\
**Post date:** [March 28, 2006, 11:53pm UTC](https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293/2 "2006-03-28T23:53:34Z")

</div>

> I can’t figure out how to compile php with fcg enabled.  
> I don’t get any error, but 127.0.0.1/test is still pointing at the package  
> from  
> [http://www.entropy.ch/software/macosx/php/](http://www.entropy.ch/software/macosx/php/) and the apache config file  
> has the info from the entropy package.  
> Can someone points me to some info on how to do this?

Php-related question ought to be forwarded to a php-related list.

I wrote a os x howto partly based on hivelogic’s howto. You can read  
it at  
[http://cguttesen.blogspot.com/2006/03/installing-rails-and-friends-on-os-x.html](http://cguttesen.blogspot.com/2006/03/installing-rails-and-friends-on-os-x.html)

Claus

---

<div class="post-metadata">

**Author:** ![anne001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@anne001](https://www.ruby-forum.com/u/anne001)\
**Post date:** [March 29, 2006, 12:42am UTC](https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293/3 "2006-03-29T00:42:28Z")

</div>

Yes I did post on the comp.lang.php site, and perhaps I should also find  
fcgi  
or darwinport sites.  
But rails folks seemed the most likely to be installing fcgi for apache?

thank you for your link. I had not seen your site. I will study it and  
see  
if it could help

## thanks for your response.

View this message in context:  
[http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3639636](http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3639636)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![anne001](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/34f0e0/32.png) [@anne001](https://www.ruby-forum.com/u/anne001)\
**Post date:** [March 29, 2006, 4:47am UTC](https://www.ruby-forum.com/t/compiling-php-with-fcgi-on-tiger/89293/4 "2006-03-29T04:47:51Z")

</div>

I found a website which shows how to compile php for tiger  
[http://maxo.captainnet.net/installs/tiger/php/index.html](http://maxo.captainnet.net/installs/tiger/php/index.html)

actually the test file has the configure command so I could probably  
have  
taken Mark’s package install  
[http://www.entropy.ch/software/macosx/php/](http://www.entropy.ch/software/macosx/php/)  
looked at the test file section on configuration, copied that, and added  
the  
3 fcgi commands at the end.

‘./configure’ ‘–prefix=/usr/local/php5’ ‘–mandir=/usr/share/man’  
‘–infodir=/usr/share/info’ ‘–with-apxs’ ‘–with-ldap=/usr’  
‘–with-kerberos=/usr’ ‘–enable-cli’ ‘–with-zlib-dir=/usr’  
‘–enable-trans-sid’ ‘–with-xml’ ‘–enable-exif’ ‘–enable-ftp’  
‘–enable-mbstring’ ‘–enable-dbx’ ‘–enable-sockets’  
‘–with-iodbc=/usr’  
‘–with-curl=/usr’ ‘–with-config-file-path=/etc’  
‘–with-mysql=/usr/local/mysql’ ‘–enable-fastcgi’  
‘–enable-discard-path’  
‘–enable-force-cgi-redirect’

since I used Mark’s package before I used this. the apache config file  
should be ok with this new install, since there already is some info  
telling  
apache to enable php5 in the httpd.conf file.  
and now hopefully I have fastcgi! the test file does not say  
explicitely.

## Hope this can help someone else having similar woes.

View this message in context:  
[http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3642430](http://www.nabble.com/compiling-php-with-fcgi-on-tiger-t1357121.html#a3642430)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).
