Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrgrill

macrumors newbie
Original poster
Aug 3, 2004
23
0
Leeds, UK
Hi.

I'm thinking of switching from PC to MAC. I have been learning PHP and using apache on my PC. However I want to know how easy it is to code PHP and have a personal web server on a MAC? I know mac's are based on Linux, so I'm assuming this is all easy

Can anyone tell me how to get a personal web server installed and how to get PHP running on a Mac. If it's an arse ache, then I'm not gonna switch. Please say it's easy as I have my heart set on changing platforms.

Many thanks
 
mrgrill said:
Hi.
I know mac's are based on Linux ...

OK, no.

Mac OS X is based on FreeBSD.

But other than that it should be easier than you think.
I am sorry that I have no info on PHP, but I am sure someone will. I just needed to correct that linux thing... oohh I feel dirty... {sings "Crying game" while huddles in the shower} :) :) :)

OK I found a link from Apple on PHP. Click me.
 
Mac OS X is not based on linux; it's based on NeXTStep, BSD & Pre OS X Mac OSes.

That said, Apache, PHP, mySQL, and pretty much any other open source server software you can think of runs better on OS X than it does on Windows.
 
mrgrill said:
Hi.

I'm thinking of switching from PC to MAC.
Good choice! (Sorry, but it's MacRumors, and someone needs to say this)

mrgrill said:
I have been learning PHP and using apache on my PC. However I want to know how easy it is to code PHP and have a personal web server on a MAC? I know mac's are based on Linux, so I'm assuming this is all easy
As noted above, it's as easy or easier - in fact, essentially exactly the same - to do these things on a Mac (which, as we've established, doesn't run Linux).

mrgrill said:
Can anyone tell me how to get a personal web server installed and how to get PHP running on a Mac. If it's an arse ache, then I'm not gonna switch. Please say it's easy as I have my heart set on changing platforms.

Many thanks
Apache comes installed in any OS X system. So, um, I guess it doesn't get any easier than that. I'm ignorant of PHP (know what it is, sort of, seen it in action, but otherwise ignorant), but suppose that it is either part of Apache or also comes pre-installed.

Essentially, what you want to do uses components that will come with your Mac, and the tools you'd use to play with it can either be the pre-installed ones, freeware, or any of a number of standard Web-development tools available on the Mac.

Place the order, man. Your Mac's waiting for you.
 
The web server and PHP are already preinstalled on OS 10.3. The only thing you will have to do is edit the Apache configuration file so it will load the PHP4 module. After editing the file, restart the webserver and you are up.
 
Check out http://www.serverlogistics.com/

They provide easy-to-install versions of Apache 2.x, PHP 4.3.x, and MySQL 4.x. The only downside is that they aren't the very newest releases of any of these pieces of software, but that shouldn't make a huge difference. All packages are also very well documented, so you shouldn't run into any problems.

As suggested above, you can also just work with what's included with OS X, which may be the best route to go (aside from MySQL).
 
zarathustra said:
OK, no.

Mac OS X is based on FreeBSD.

Actually, I believe the Darwin kernel is based on OpenBSD, but I may be wrong. Nitpicky difference, anyway. :rolleyes:

I'm using an OS X-based test platform for my Apache/PHP apps right now. I don't do anything to the standard Apache install, except add a PHP module from this guy. It enables a lot more functionality (re: modules!) than the standard OS X PHP module. And it enables the PHP module in Apache's config for you.

If just the basics are good enough, though, you can simply activate the PHP module that's built into OS X. You want to edit /etc/httpd/httpd.conf and un-comment (remove the '#') from the lines that say:
Code:
#LoadModule php4_module        libexec/httpd/libphp4.so
and
Code:
#AddModule mod_php4.c
and then activate Apache by going to System Prefs>Sharing>Personal Web Sharing. I think that pref is in a slightly different spot in Panther, but it's pretty easy to find nonetheless.

Once that's done, you can add an 'index.html' or 'index.php' to the Sites directory in you Home folder, and you're good to go. Point a browser at "http://localhost/~username/" and you'll see your test site.

Rock on, and great question!
:) -rand()
 
gorman said:
Check out http://www.serverlogistics.com/

They provide easy-to-install versions of Apache 2.x, PHP 4.3.x, and MySQL 4.x. The only downside is that they aren't the very newest releases of any of these pieces of software, but that shouldn't make a huge difference. All packages are also very well documented, so you shouldn't run into any problems.

As suggested above, you can also just work with what's included with OS X, which may be the best route to go (aside from MySQL).

For MySQL, just go to www.mysql.com and they already have pre-built packages for OS X of the latest. As for Apache and PHP, you may be best to go to the URL above for simplicity.
 
entropy.ch is the only place you need to go for info on installing/configuring PHP & MySQL under OS X.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.