[nycphp-talk] pcntl_fork() assistance

csnyder chsnyder at
Wed Sep 20 19:55:25 EDT 2006

On 9/20/06, Joseph Crawford <codebowl at> wrote:

> If ANYONE has any resources i could read about compiling LAMP on the mac i
> would appreciate it.  Everyone is telling me to just go with a precompiled
> package and would if any of them enabled pcntl :)

This should get you php5 on osx 10.4. It doesn't have pcntl enabled,
it's just supposed to mirror the default php4 binary, but with php5

Sorry it's rough, these are just my notes so I can do it again.

Step By Step

   0. Install the latest Developer Tools

   1. Install Fink

   2. Update fink (follow all instructions) and install necessary packages

      fink selfupdate

      fink install svn-client screen freetype2-hinting-dev libpng3
t1lib5 tidy-dev libjpeg wget uw-imap-c-client-ssl

   3. Install MySQL, MySQL Startup Item, and PrefPane (double-click to install)

   4. Download PHP source -- use the latest, this is just an example
      PHP 5.1.4 (tar.bz2) [5,852Kb] - 04 May 2006
      md5: b55e633bdc80ab30da7c92f760fc4b58

   5. Unpack php into /usr/local/src

      cd /usr/local/src
      md5sum ~/Desktop/php-5.1.4.tar.bz2
      #does md5 hash match?
      tar xjvf ~/Desktop/php-5.1.4.tar.bz2
      cd php-5.1.4/

   6. Configure php:

      './configure' '--prefix=/usr' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--with-config-file-path=/etc'
'--sysconfdir=/private/etc' '--disable-dependency-tracking'
'--with-apxs' '--enable-dbx' '--enable-exif' '--enable-ftp'
'--enable-mbregex' '--enable-mbstring' '--enable-sockets'
'--with-curl=/usr' '--with-freetype-dir=/sw/lib/freetype2' '--with-gd'
'--with-gettext=/sw' '--with-iodbc=/usr' '--with-kerberos=/usr'
'--with-ldap=/usr' '--with-mysql=/usr/local/mysql'
'--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-openssl'
'--with-png-dir=/sw' '--with-jpeg-dir=/sw' '--with-readline'
'--with-t1lib=/sw' '--with-tidy=/sw' '--with-xml' '--with-xmlrpc'
'--with-zlib-dir=/usr' '--without-xpm' '--with-expat-dir=/sw'
'--with-iconv=/usr' '--with-imap=/sw/share/c-client'

   7. Build and install php:

      sudo make install

   8. You should check the Apache configuration at
/etc/httpd/httpd.conf. It should have the following configuration
directives (make sure any directives pertaining to php4 are commented

      nano -w /etc/httpd/httpd.conf

      # php5 support (Apache 1.3 version)
      LoadModule php5_module libexec/httpd/
      AddModule mod_php5.c
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
      DirectoryIndex index.html index.php

   9. Restart apache (sudo apachectl restart) and test for php.

      sudo apachectl restart
      open /Applications/ http://localhost/path/to/info.php

Should take about four hours given the size of the downloads involved
and the configuration time.

Chris Snyder

More information about the talk mailing list