gorn.ch

Tobias Ebnöther's personal blog

Leopard native apache with custom (64bit) PHP

With massive! help from Marc Ammann I was able to build a PHP Binary that loads with the Leopard shipped Apache.

First I got iconv source from apple and took the libiconv/include/iconv.h.build.in file. It seems that apple uses different headers in the build process than installed. So the build headers use precompiler flags that gcc doesn't know (it's most likely some sort of XCode stuff which I don't know anything about). After removing that stuff the file looks like this.

With this file as a replacement for /usr/include/iconv.h PHP will build with CFLAGS='-arch x86_64' and load with the native apache afterwards. It's even possible to build the pecl memcache extension like that (but don't forget the right arch).

For completion that were my configure flags:
CFLAGS='-arch x86_64' ./configure \
'--with-zlib' \
'--with-apxs2=/usr/sbin/apxs' \
'--prefix=/usr/local/php5' \
'--with-iconv' \
'--with-xsl' \
'--disable-xmlreader' \
'--with-jpeg-dir' \
'--with-png-dir=' \
'--enable-bcmath' \
'--with-curl' \
'--with-ldap' \
'--enable-mbstring' \
'--enable-soap'
Related Entries:
Leopard PHP / Apache Package with pecl support
xchat on OSX / Command as alt
Setting up relayhost for postfix on OSX (with ssl and authentication)
Jackalope presentation and status
MacHeist Software Bundle
Comments (8)  Permalink

Leopard PHP / Apache Package with pecl support

After some hours of blood and sweat I finally managed to get a nicely working Apache / PHP Setup (YES! With a working version of pecl).

I usually us the great! package from Marc which does unfortunately not work nicely on Leopard yet (I hope it's not too much stress for him :) ).

Until he is done (and I switch back) I can provide this package which is very dirty and untested (works for me).


If you'd like to install it try like that:

Unpack to /usr/local like this
cd /usr/local
tar xjvf <the package>

Then you need to make some changes in /etc/apache2/httpd.conf
Change the following line:
ServerRoot "/usr"
To this:
ServerRoot "/usr/local/httpd"

COMMENT (type a # on the beginning of the line) the following lines:
LoadModule cache_module libexec/apache2/mod_cache.so
LoadModule disk_cache_module libexec/apache2/mod_disk_cache.so
LoadModule mem_cache_module libexec/apache2/mod_mem_cache.so
LoadModule proxy_module libexec/apache2/mod_proxy.so
LoadModule proxy_connect_module libexec/apache2/mod_proxy_connect.so
LoadModule proxy_ftp_module libexec/apache2/mod_proxy_ftp.so
LoadModule proxy_http_module libexec/apache2/mod_proxy_http.so
LoadModule proxy_ajp_module libexec/apache2/mod_proxy_ajp.so
LoadModule proxy_balancer_module libexec/apache2/mod_proxy_balancer.so
LoadModule ssl_module libexec/apache2/mod_ssl.so
LoadModule bonjour_module libexec/apache2/mod_bonjour.so

Finally UNCOMMENT (remove the #) this line:
#LoadModule php5_module libexec/apache2/libphp5.so

Now you just need to start your brand new apache / php setup like the following:
sudo /usr/local/httpd/sbin/apachectl start 


If you want to build your own setup here is what I did:
Related Entries:
Leopard native apache with custom (64bit) PHP
xchat on OSX / Command as alt
Setting up relayhost for postfix on OSX (with ssl and authentication)
Jackalope presentation and status
MacHeist Software Bundle
Read whole postComments (4)  Permalink
1-2/2
Powered by Flux CMS