Papelipe / Tags / PHP / Compiling Apache and PHP on Mac OS X

Right menu


Sun Mon Tue Wed Thu Fri Sat
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29

Compiling Apache and PHP on Mac OS X

Since my recent move to the Mac running OS X I have learnt some new stuff about PHP and Apache the hard way. OS X is shipped with Apache and PHP by default and if you compile Apache and PHP like you normally do under Linux you quickly get surprised. When I compile Apache I always use a prefix so I have it installed under /usr/local/apache or something like that. I like to have it installed like this so I can quickly change between Apache and PHP versions and configurations. Under OS X you quickly notice that Apache is not completely installed in the directory you added as prefix. The reason for that is that Apache has a different installation layout under OS X. So, you simply have to use the configure parameter --with-layout to make things work like you are used to.

The compilation switches I use are:

cd apache_1.3.34
make clean
./configure --prefix=/usr/local/apache \
                    --enable-module=so \
                    --enable-module=rewrite \
sudo make install
cd ..
cd php-4.4.2
make clean
./configure --prefix=/usr/local/apache  \
            --enable-mbstring \
            --with-apxs=/usr/local/apache/bin/apxs \
            --enable-cli \
            --enable-exif \
            --with-mysql \
sudo make install 

Entry filed under: PHP | Trackback this post

Trackbacks (0)

» No Trackbacks

Comments (2)

Packers and Movers

Packers and Movers in Chennai @
Packers and Movers in Hyderabad @
Packers and Movers in Bangalore @

installing PHP 4.4 in OS X

I want to install php 4.4 so I can try out EZ-publish on my mac. I went to and there is no 4.4 installer. i asked at the forum. But the guy suggested not to install php apps that couldent run on php 5 which there are installers for.

I can see you have installed php 4 and wonder if i can just do it like you have. Dont like the Terminal, but maybe the only installer?

Erland, Lillehammer
ps tenkte jeg skulle spørre på engelsk i tilfelle andre vilkjøre ez på macen