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]
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.
You must be logged in to the O'Reilly Network to post a talkback.
Showing messages 1 through 6 of 6.
-
support of dl()
2003-02-23 23:41:15 tychay [Reply | View]
Thank you so much for mentioning that PHP doesn't yet support dl() (dynamic loading of extensions). This solved some headaches when I reverted my PHP 5 installation back to PHP 4.3.1!
I can report that PHP 5 (in CVS as php4-ze2) seems to support dynamic loading of PHP extensions for Mac OS X just fine. :-) I'll have to see if the php4 cvs supports it.
-terry
-
vertical integration
2001-08-16 08:08:18 weberik [Reply | View]
Here's why I'm so excited about PHP on OS X. Finally we have one platform that can encompass the following:
1) Web architecting (using Create, Illustrator, OmniGraffle, etc.)
2) Front-end design (using Canvas, Flash, Dreamweaver, BBEdit, etc.)
3) Native development and testing of powerful dynamic web-building tools (PHP, Perl, Python, WebObjects!, FileMaker, MySQL, PostgreSQL, etc.)
4) Seamless deployment on a server variant of the development platform (OS X Server) and other related platforms (Linux, the BSDs, Solaris) with minimal hassle.
This is an extremely compelling strength for OS X - one that I haven't read much about in the press. As a web developer, I'm very excited about having my Mac and having a BSD - all in the same machine, with the same OS.
Amazingling, the new Apple OS is more open and plays well with others far better than Microsoft's proprietary OSes. It's a judo move that Apple is only beginning to take advantage of right now, but will become more and more apparent as things progress.
The Mac is still seen as a machine for "niches" like education and graphic arts. But if Apple and its users continue to leverage the strengths of tools like PHP (which absolutely kicks ass), many who adopted Linux because of the wide range of tools it supports may be taking a closer look at the Mac. And those poor developers who are currently using ASP may wake up and smell the coffee - "Gee, I can use a Mac to do every aspect of development AND deployment, using a toolset that's easier, faster, and more capable than the pap Microsoft has been shoving down my throat."
-
PDF support
2001-07-29 05:09:00 archangel23 [Reply | View]
You should have mentioned that you need the pdflib and that the make error occurs not while compiling the TIFF lib but the pdf lib. Your solution hasn't worked for me. You have to make a symbolic link named "Perl" from /Library to /System/Library/Perl.
When configuring PHP, it finds the library, but I get the following errormessage:
checking for PDF_show_boxed in -lpdf... no
configure: error: pdflib extension requires at least pdflib 3.x.
I've got PDFlib 4.0.1 so what's wrong? All .a files are located in /usr/ local/lib and configure can successfully find the jpeg and tiff lib.






One question:
Where do I find the php.ini file? Or does it have a different name in the mac than in the pc?
I,m trying to install a program and get the error message: Fatal error: register_globals is disabled in php.ini, please enable it!
But I can't fint the php.ini- file!