macdevcenter.com
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button

PHP on Mac OS X
Pages: 1, 2

XML

The --with-xml flag works without any additional configuration.



WDDX

WDDX support works if the --enable-wddx flag is included. XML support must be included for WDDX to function.

GD

GD can be a bit tricky to configure the first time through. A few non-intuitive modifications or flags are needed to get all of the packages involved in GD to compile together. However, Scott Anguish at Stepwise.com has supplied a nice set of instructions that ease the process. Copy his commands into your terminal window, then compile PHP using the following flags:

--with-gd=[DIR]
--with-jpeg-dir=[DIR]
--with-png-dir=[DIR]

PDF

To install PDF support, it is necessary to install the TIFF libraries. Before you can install the TIFF libraries, you will need to replace the config.guess and config.sub files that come with this package. You can find more recent copies of these files that work with OS X in /usr/libexec. You also need the JPEG libraries. Instructions on installing those are included in Stepwise's GD instructions.

Version 3.5.6 of the TIFF library has a nice interactive install process that prompts you as to whether the directories it's found to install in are correct. Currently, the configure process works, but dies during the make process, giving the following error:

/usr/bin/install: /Library/Perl/libpdflib_pl.dylib: No such file or directory
make[1]: *** [install] Error 1

To work around this error, you can copy the files in the pdflib-4.0.1/bind/perl/.libs/libpdflib_pl.dylib directory to /System/Library/Perl. Then create a symbolic link to the directory the make process is looking for:

sudo ln -s /System/Library/Perl/Library

At this point, the make process will work, and you can finish the install. You can compile PDF support into PHP using the following flag:

--with-pdflib=[dir]

cURL

The cURL client libraries offer a way to conduct transactions of https, among other things. The current source compiles and installs into PHP without issue. You can compile cURL then include it in PHP with the following flag:

--with-curl=[dir]

Conclusion

The PHP extensions discussed here are all that most PHP developers will need. However, if you need additional support compiled into PHP, chances are that the module you need will work. If it doesn't work immediately, you can always hit the mailing lists. Those who maintain the code will most likely be happy to help you get it working on the Mac platform.

Editor's Note: This article is the first in a series of cooperative tutorials with the Apple Developer Connection. If you have comments, additions, tips, or clarifications, I encourage you to use our Talk Back feature so that your ideas can be shared with O'Reilly Network readers.

Jay Greenspan is a contributing author for Apple Developer Connection.


Return to the Mac DevCenter.