PHP
downloads | documentation | faq | getting help | mailing lists | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Installation on Windows systems> <Installation on Mac OS X
Last updated: Fri, 28 Nov 2008

view this page in

Installing for Apache on MacOS X Client

The following instructions will help you install a PHP module for the Apache web server included in MacOS X using the MacOS GUI. This version includes MySQL, PostgreSQL, and iODBC database support, cURL, GD, PDFLib, LDAP, and more. These instructions are graciously provided by » Marc Liyanage.

Avertizare

Be sure you know what you're doing before advancing beyond this point! You can cause irreparable harm to your Apache installation otherwise.

Notă: These instructions will only work with the original Apache web server as shipped by Apple. If you re-built or upgraded your Apache, you will have to build your own PHP module.

To install:

  1. For Apache 1.3, download: http://www2.entropy.ch/download/entropy-php-5.2.4-1.tar.gz
  2. For Apache 2, download: wget http://www2.entropy.ch/download/entropy-php-5.2.4-1-apache2.tar.gz
  3. Unpack the compressed .tar.gz file, but DO NOT USE StuffIt Expander. Instead, use Apple's BOMArchiveHelper or the command line.
  4. Double-click the installer package and follow the directions of the installer application.

That's all! PHP should now be up and running. You can test it by dropping a file named test.php into your Sites folder in your home directory. Into that file, write this line: <?php phpinfo() ?>.

Now open up 127.0.0.1/~your_username/test.php in your web browser. You should see a status table with information about the PHP module.



add a note add a note User Contributed Notes
Installing for Apache on MacOS X Client
mdoyle at cooperationireland dot org
07-Apr-2008 05:54
With OSX 10.5, the bundled version is up to date but didn't come with the modules I needed (notably I wanted the pgsql database extension).

Getting this to work was quite simple in the end, what made it difficult is the build-options for Apache. After searching on google, I found instructions to re-build apache with the following options:

./configure --enable-layout=Darwin --enable-mods-shared=all

(Step 1: download the latest Apache2.2 source files,
 Step 2: extract the tarball
 Step 3: ./configure --enable-layout=Darwin --enable-mods-shared=all
 Step 4: make all
 Step 5: sudo make install)

Without this step, when I rebuilt PHP either directly with the source from the PHP.net site or using MacPorts I was getting an error about the wrong architecture like this one:

httpd: Syntax error on line 114 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found.  Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture

After re-building and Apache with the configuration above and  restarting it, everything worked again and I can now use PostgreSQL from within PHP on my MacBook Pro.
rahul
08-May-2007 10:54
if `wget` isn't installed or not in your path use `curl -O` instead.

Installation on Windows systems> <Installation on Mac OS X
Last updated: Fri, 28 Nov 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites