Skip to main content
Inspiring
October 27, 2007
Question

Mac OS X Leopard and PHP

  • October 27, 2007
  • 19 replies
  • 1062 views
Posted in both the Dreamweaver and Dreamweaver Application Development
forums.

Mac OS X 10.5 (Leopard) uses Apache 2.2.6. This is NOT compatible with
the Mac PHP package recommended in all my books. Marc Liyanage
(www.entropy.ch/home) is aware of the problem, but there is no ETA for
an update.

If you have upgraded to Leopard and want to develop PHP pages on your
Mac, you might want to try MAMP (www.mamp.info/en/mamp.html) instead. I
haven't tested it myself yet, but it has a very good reputation.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
This topic has been closed for replies.

19 replies

Inspiring
October 28, 2007
jsteinmann wrote:
> Your up and running with Apache 2 and Php 5... all built in... life is good.

Not quite. The preinstalled version of PHP 5 doesn't use php.ini. You
need to make a copy of /private/etc/php.ini.default and save it as
php.ini. Then make any changes you need to the php.ini file itself.

Another problem is that the Apache 2 setup won't let you view files in
your personal Sites folder. A guy called Dan Brown has posted details of
how to fix that problem in a comment on my blog:

http://foundationphp.com/blog/2007/10/27/php-and-mac-os-x-leoparda-warning/#comments

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
October 28, 2007
By the way, I've heard this is nice way to simplify things and get people up and running very quickly to develop in PHP/APACHE/MySQL

http://www.apachefriends.org/en/xampp.html

Haven't tried it, but looks decent... and it's free as expected with open source
October 28, 2007
I got PHP working with Leopard by modifying the Apache 2 httpd.conf file...

- Finder > Go > Go To Folder
- type in /etc
- then going into the Apache2 folder and copy httpd.conf to the Desktop (it won't let you edit in place).
- Change to a txt file so you can edit
- Find the line that says LoadModule php5_module and remove the #
- Save the file back into the .conf format and drag-drop into Apache 2 folder
- It may ask you to authenticate, click yes, and replace old one.
- Then restart apache by switching personal web sharing off and on in the sharing pref pane.

Your up and running with Apache 2 and Php 5... all built in... life is good.

It would have been nice to have it turned on by default, but hey, that's the way it goes. By the way, error on my part about MySQL. Appeared to work from the terminal, but had a few minor issues (for me anyway). Too many developers out there to not have that resolved yesterday, so I expect a quick fix for that as well.

All in all, I like the changes with Leopard... huge leap forward.
Inspiring
October 27, 2007
jsteinmann wrote:
> I downloaded MySQL 5 for Mac OSX 10.4 and it worked fine on Leopard. Went to
> Terminal and typed in php -v and it says I have PHP version 5.2.4 running.

Thank you for pointing that out. I have installed Leopard on two
computers: one a PowerBook that has been upgraded from OS 10.3 to 10.4
and now to 10.5; the other is a Mac mini that came equipped with 10.4,
but was immediately upgraded to 10.5. On the latter machine, I do,
indeed have PHP 5.2.4, although you need to enable it manually. On the
older machine, running php -v in Terminal reports PHP 5.2.4, but the
Apache configuration file still uses PHP 4.

The Mac mini works fine with files stored in
/Library/WebServer/Documents, but not in my username Sites folder.

I'm obviously going to need to do more research, but Apple certainly
hasn't made for a smooth transition to PHP 5.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
October 27, 2007
I downloaded MySQL 5 for Mac OSX 10.4 and it worked fine on Leopard. Went to Terminal and typed in php -v and it says I have PHP version 5.2.4 running. I had no issues and I didn't download anything from PHP.net. I was able to follow the directions at http://www.adobe.com/devnet/dreamweaver/articles/setting_up_php_05.html to setup the MySQL. It honestly took me less then 5 minutes.
October 27, 2007
Keep me updated... cause I want to start developing PHP on my MAC...
Inspiring
October 27, 2007
jsteinmann wrote:
> According to the technical specs of Leopard OSX 10.5, PHP is already part of
> the operating system (as well as SQLite, Ruby, Ruby on Rails, Perl, and Python)
> and the Apache 2 server. Sounds like a perfect OS for PHP development.

The preinstalled version of PHP is PHP 4 - a bizarre choice for Apple to
make since PHP 5 was released more than three years ago, and PHP 4
reaches its end of life on 31 December. Moreover, the preinstalled
version is not enabled by default.

In spite of the much trumpeted "ease of use" of Macs, Apple doesn't
actually make life easy for PHP developers. Once things are set up
correctly, though, it is good.

--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
October 27, 2007
http://www.apple.com/macosx/techspecs/
For Development:
Xcode 3 IDE with Interface Builder 3
Instruments
Dashcode
AppleScript Studio
Automator 2
Shark
GCC compiler and toolset (original project by FSF.org)
DTrace (original project by Sun)
Complete Java JDK, including javac, javadoc, ANT, and Maven tools
Apache web server
AppleScript
Ruby and the Ruby on Rails frameworks
Python
Perl
PHP
SQLite


October 27, 2007
Good to know. I did upgrade to Leopard. Unlike past OSX upgrades that added functionality, this was clearly a major one down to the core.

According to the technical specs of Leopard OSX 10.5, PHP is already part of the operating system (as well as SQLite, Ruby, Ruby on Rails, Perl, and Python) and the Apache 2 server. Sounds like a perfect OS for PHP development.