Installing PHP4.04 on OS X v10.0
Mar 27, '01 08:33:58AM
Contributed by: robg
A generous Mac user, 'olav', has made a pre-packaged double-click PHP 4.04 installer available! Thanks to 'jacco' for the pointer to the address.
NOTE: The following instructions apply to the files found in the "Archive" folder on olav's iDisk -- see the comments for a discussion of problems related to the new package that's also there at the root level. I installed from the 'Archive' files, and had no problems at all.
You can find the PHP files on olav's iDisk, right here.
This is about as easy as it gets for installing PHP 4; read the rest of this article if you'd like the (simple) step by step instructions.
NOTE: These steps assume some familiarity with the terminal window and UNIX in general, which is a Good Thing to have if you're going to be using PHP (and mySQL).
On Olav's iDisk, in the Archives folder, you'll see three files:
httpd.conf - the Apache configuration file
phpinfo.php - a test php script, to prove it's working
php-4.04pl1.tgz - the pre-packaged PHP 4.04
Here's how I installed it and got it working.
- Download all three files to a convenient location.
- Stop the webserver if it's running (via the GUI or "apachectl stop")
- Make a backup copy of your httpd.conf file, and then move the new httpd.conf into /etc/httpd. If you've extensively modified your httpd.conf, you'll probably just want to to a 'diff' on the two files to see what's been changed, and hand edit your original.
- Move phpinfo.php to your preferred webserver documents location. Apache comes pre-configured to serve documents out of either /Library/WebServer/Documents, or /Users/username/sites, so take your pick. If you use the "sites" folder, the URL is http://[your address]/~username; otherwise, it's just http://[your address].
- Unpack the installer. When I downloaded it (with OW 4.0fc3), Stuffit tried to expand the archive. It sort of worked, but I didn't wind up with a usable file. So I took the '.tar' file that resulted, and simply typed "tar -xvzf php-4.0.4pl1.tgz", which created an installer package on the desktop.
- Double-click the installer, enter your password, and watch it install.
- Restart the Apache webserver (again, GUI or 'apachectl start').
- Test your PHP install by loading the test file: http://[your address]/phpinfo.php (or the alternate version if you're using the sites folder). You should get a cool page of system info.
That's it! Thanks, Olav, for getting this done so quickly!
Comments (24)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20010327083358205