#contents index prev next alternate PHP downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net search for ______________________________ in the [function list_____________] search * PHP Manual * Installation und Konfiguration * Generelle Überlegungen * Installation auf Unix-Systemen * Installation unter Mac OS X * Installation on Windows systems * Installation auf Cloud Computing Platformen * FastCGI Process Manager (FPM) * Installation of PECL extensions * Problems? * Laufzeiteinstellungen Verwendung von Paketen > < Debian GNU/Linux-Installationshinweise __________________________________________________________________ [edit] Last updated: Fri, 18 Jan 2013 view this page in [English_____________] Change language Installation unter Mac OS X Inhaltsverzeichnis * Verwendung von Paketen * Das enthaltene PHP verwenden * Kompilieren von PHP unter Mac OS X Diese Kapitel beschreibt die Installation von PHP unter Mac OS X. PHP wird auf Macs ausgeliefert; das Kompilieren ist ähnlich zur Installation unter Unix. Verwendung von Paketen > < Debian GNU/Linux-Installationshinweise __________________________________________________________________ [edit] Last updated: Fri, 18 Jan 2013 add a note add a note User Contributed Notes Installation unter Mac OS X - [10 notes] up down 2 Dan Black ¶ 5 years ago My httpd.conf had some of the lines, but not all of them -- mine was missing the LoadModule and AddModule lines for php. I'm not sure why -- I don't delete any of those; I just comment them out if I'm not using them. Plus, the note above put a space in "LoadModule"; it has no space. I didn't know about the "apachectl graceful" trick, though -- since "httpd -k restart" stopped working (probably around 10.2), I had just been doing it manually -- find the process, kill it, and hit httpd again -- thanks for the tip! So for those who are missing any of the lines, here are the full lines. In the section with all the other LoadModules: LoadModule php4_module libexec/httpd/libphp4.so Directly below that section should be the AddModules; you need: AddModule mod_php4.c And then the AddType lines should be right after the language priorities (so after the AddCharset lines and after the LanguagePriority bit): AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps Then restart apache/httpd as described above, and hopefully you should be good. BTW, the actual module should be at: /usr/libexec/httpd/libphp4.so So if things fail, you can check to see if that's there. Thanks to others who posted here; it definitely helped and got me on the right track. I just had to find the module manually to write my own LoadModule line. up down 0 Jeff Hayden ¶ 6 years ago Just a note. The darwinports software is now macports and you can get it at: http://www.macports.org/ If you use macports, be sure to change any refernces you may have in your calling scripts to macports as the file macports now gets installed. up down 0 lanhel at mac dot com ¶ 11 years ago Getting PHP running on 10.1 is simple. 1. su to root 2. Edit /etc/httpd/httpd.conf 3. Uncomment "Load Module php4_module" line. 4. Uncomment "AddModule mod_php4.c" line. 5. Uncomment "AddType application/x-httpd-php .php" line. 6. Uncomment "AddType application/x-httpd-php-source .phps" line. 7. Find "" block and uncomment the entire Directory directive block. This will allow PHP to execute from ~/Sites directory. up down 0 andreas at fink dot org ¶ 8 years ago To build on MacOS X 10.3.5 set the environment variable CFLAGS in the following way (depending on your shell) setenv CFLAGS "-DBIND_8_COMPAT=1 -DEAPI -O3" export CFLAGS="-DBIND_8_COMPAT=1 -DEAPI -O3" Then launch configure with the options: ./configure --prefix=/usr --mandir=/usr/share/man .... The -DBIND_8_COMPAT=1 gets you over a problem in the DNS files because MacOS X has definitions for Bind9 and PHP expects Bind8 definitions. -DEAPI is needed if you build it for Apache 1.3.31. -O3 enables the gcc optimizer. You can also add one of the following lines to your CFLAGS depending on the CPU you use to further improve speed: -mcpu=G3 -mtune=G3 -mcpu=G4 -mtune=G4 -mcpu=G5 -mtune=G5 up down 0 Rick ¶ 9 years ago under MacOS 10.3 if your compile fails vi Makefile find the dns.c entry add the switch -DBIND_8_COMPAT run make again up down 0 jack dash pinette at uiowa dot edu ¶ 9 years ago PHP 4.3.0 can easily be build on Mac OS X client; you don't need to download a binary. The process is quite fast and painless. See http://www.onlamp.com/pub/a/php/2003/01/17/phpcookbook.html for details. up down 0 php at radicalcomputingconcepts dot com ¶ 10 years ago 10.1 with fink installed into /sw ,mysql installed from fink. finally : Apache/1.3.24 (Darwin) DAV/1.0.3 PHP/4.2.1 mod_ssl/2.8.8 OpenSSL/0.9.6c configured initial apache config: ./configure --prefix=/sw --enable-shared=max --enable-module=most --target=apache --with-layout=GNU --enable-suexec --suexec-caller=www-data then php config: ./configure --prefix=/sw --with-xml --with-apache=../apache_1.3.24 --with-curl=/sw --with-pdflib=/sw --enable-exif --with-mysq=/sw then mod-ssl config: ./configure --with-apache=../apache_1.3.24 --with-ssl=/sw --enable-rule=SSL_SDBM final apache config: ./configure --prefix=/sw --enable-shared=max --enable-module=most --target=apache --with-layout=GNU --enable-suexec --suexec-caller=www-data --activate-module=src/modules/php4/libphp4.a --enable-module=ssl on final make of apache there was error in src/modules/ssl. i had to rm -ldbm and -lgcc and run gcc line by hand. then was able to finish make. i dont know what effect that may have on the build and i am interested to know, this was the only problem spot finally after many hours of hacking at it. testing so far: phpinfo() via http and https works. up down 0 info at ericbontenbal dot nl ¶ 10 years ago for using PHP on MacOSX, see article #106485 of the Apple knowledge base up down 0 larry(at)shafferinteractive.com ¶ 11 years ago For the latest on Mac OS X PHP installs (as of 10.0.4 on 9.24.01) check out http://developer.apple.com/internet/macosx/php.html This page also has some info on MySQL installs. up down -1 oster at ieee dot org ¶ 11 years ago If you've got Mac OS X pre-installed on your Mac, you've also got php4 pre-installed. You don't need to download or compile anything. You just need to edit the /etc/httpd/httpd.conf file. Use the "sudo open -a TextEdit..." command line, above. Search for "php", and make sure you've un-commented _all_ the relevant lines: the two AddType lines above, and also the AddModule and LoadModule lines. (but not the AddType lines for php3, since you'll be using php4.) Save and restart Apache with "sudo apachectl graceful", and you are done. add a note add a note show source | credits | stats | sitemap | contact | advertising | mirror sites Copyright © 2001-2013 The PHP Group All rights reserved. This unofficial mirror is operated at: http://php.net/ Last updated: Wed Jan 23 08:41:03 2013 PST