Administration
  Home arrow Administration arrow Page 5 - Building Apache, MySQL, and PHP on Mac OS X
Dev Shed Forums  
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Smartphone Development  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Mobile Linux  
App Generation ROI  
IBM® developerWorks  
Forums Sitemap  
E-Commerce Hosting  
Linux Web Hosting  
Managed Hosting  
Small Business Hosting  
VPS Hosting  
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid  
Request Media Kit
Contact Us  
Site Map  
Privacy Policy  
Support  
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
Google.com  
ADMINISTRATION

Building Apache, MySQL, and PHP on Mac OS X
By: Lucas Marshall
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: starstarstarstarstar / 9
    2001-05-21


    Table of Contents:
  • Building Apache, MySQL, and PHP on Mac OS X
  • Prerequisites
  • Making MySQL
  • Making WebDAV
  • Making PHP
  • Caveats

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      error-file:tidyout.log Del.ici.ous error-file:tidyout.log Digg
      error-file:tidyout.log Blink error-file:tidyout.log Simpy
      error-file:tidyout.log Google error-file:tidyout.log Spurl
      error-file:tidyout.log Y! MyWeb error-file:tidyout.log Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article

     
     
    ADVERTISEMENT


    Building Apache, MySQL, and PHP on Mac OS X - Making PHP
    ( Page 5 of 6 )

    The last step is to get PHP set up.

    % cd .. % gnutar zxf php-4.0.5.tar.gz % cd php-4.0.5
    Now PHP is decompressed and ready to be configured.

    % ./configure --with-mysql=/usr/local ¬ --with-apxs=/usr/sbin/apxs \
    --with-zlib=/usr

    The --with-mysql option tells the configure script that we want to use the MySQL libraries that were installed with MySQL instead of the ones that come with PHP. The --with-apxs option does the same thing it does in the mod_dav configuration, tells the configure script that we want PHP compiled as a DSO, and the --with-zlib option tells the configure script where to find the zlib libraries it needs (These are included in Mac OS X).

    Running the configure script strangely breaks one file in the distribution, main/internal_functions.c. In that file, some of the #include lines are run together into one line, and have the letter "n" separating them.

    You can edit this file manually to fix this, but I've made a Perl script that will do the trick, if you'd rather use it.

    Execute the following commands to use my script.

    % wget http://www.devshed.com/article-images/fix_php.pl
    % chmod +x fix_php.pl

    This will get the script and allow you to execute it, and

    % ./fix_php.pl
    will run it, fixing the problem.

    % make
    % sudo make install

    These commands will compile, install, and enable the PHP module.

    You're not done yet, you need to tell Apache to use the PHP module for all files with a .php extension. Edit the Apache configuration file:

    % sudo pico /etc/httpd/httpd.conf
    and remove the #s from the lines that look like this:

    # And for PHP 4.x, use:
    #
    #AddType application/x-httpd-php .php
    #AddType application/x-httpd-php-source .phps

    so they end up looking like this:

    # And for PHP 4.x, use:
    #
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps

    and restart your Apache server.

    % sudo apachectl restart
    Now, to test your PHP setup, you'll need to make a PHP script. Type the following:

    % pico /Library/WebServer/Documents/phpinfo.php
    and paste this in:

    <?php phpinfo(); ?>
    Save and exit, then open up your web browser and go to http://localhost/phpinfo.php If everything is working correctly, your browser will display a nicely formatted page with info about your PHP installation, and we're done!

     
     
    >>> More Administration Articles          >>> More By Lucas Marshall
     

       

    ADMINISTRATION ARTICLES

    - Network Booting via PXE: the Basics
    - Scalix: Linux Administrator`s Guide
    - Network Administration with FreeBSD 7
    - Components of an Information Architecture
    - The Anatomy of an Information Architecture
    - Configuring Load-Balanced Clusters
    - Load-Balanced Clusters
    - UNIX Time Format Demystified
    - Making Changes in the CVS
    - Building Your First CVS Repository
    - CVS Quickstart Guide
    - Authorizing Users in Samba
    - Handling User Accounts in Samba
    - Authentication in Samba
    - Accounts, Authentication, and Authorization





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek