2 Guys, a Mac, and a Website - The Evolution of the Web - PHP - The Very Basics
October 7th - Hey, happy pantsday.
2 Guys Store

120x60

 Search

 Classic 2 Guys
10 Random Stories:
Synergistic Effects
Refutin' Rasputin
Apple Surprises Boston Expo With New Product Debut
Microsoft is Good, Right?
Review: iPod Mini case by Otter Box
First Trojan on the Mac, or FUD?
The Words "CompUSA" & "Not Sucking" in the Same Sentence?
HP invents a cool technology. No really.
Music to Your Ears? No - Music to OUR ears!
The Very First Thanksgiving

 Comments
yum hot guys - core
You guys are the pants! - PHP WannaBe
Maybe they don't like you - so they sent you defective product. Have yo... - DJLC
A friend of mine had this product, and the antenna portion quickly came... - Cubist
And the other rule of not commenting on your own article!
...
- Jonahan


 Account
Not logged in.

Username:
Password:
Save password
Not registered?




 PHP - The Very Basics
This article is for those who've wondered what the heck PHP is and why people think it's so danged great. If you've ever seen a page named 'index.php' and wondered why it wasn't 'index.html', or you have an inkling as to what PHP is but want to learn more, then read on!


What is it?
PHP is a scripting language for the Web. People disagree about what the letters PHP stand for, but the most common definition is that it's a rescursive acronym for "PHP Hypertext Pre-procesor".

PHP is used in thousands of sites, and it's usage is growing by leaps and bounds.

PHP is often used in conjunction with a relational database of some sort, the most popular of which (mainly because it's open-source) is MySQL.

It's a fairly easy language to learn, especially if you're at all familiar with Perl or JavaScript (PHP's syntax is even kinda-sorta similar to C/C++/Objective C). It's also said that it's pretty intuitive for web designers to pick up and I'd have to agree.


Why use it?

PHP is really around just to make everyone's life easier (well, everyone's Internet life at least!). It can be used in limitless ways, but some of the most basic applications are form handling, e-Commerce, templating your site and making it easier to update, saving info in a database, and pulling info back out of that database to display it.

Pretty much this entire site is done in PHP. The Shoutbox and Poll areas are open-source PHP scripts we found, but the rest is all homemade. Some other sites that use PHP include MacRumors, PHPmac, SpyMac, and MacDailyNews. (Ok, I know those are all Mac sites, but I couldn't think of any non-Mac related ones. Trust me, there are tons!)


How to Install it/Where to get it

If you're running OS X you have PHP installed, but it's a heavily stripped down version. It'll work, but if you wanna be cool and run with the in-crowd (plus have all the modules for PHP that you'll most likely need at some point down the road) you should install a better version.

Luckily for Mac OS X users, this is pretty easy to do. A guy by the name of Marc Liyanage keeps a build of PHP current for us, along with installation instructions. Yes, you have to delve into the Terminal for some commands, but it's all just cut & paste (it's real easy, trust me).

Just go here and follow the instructions for your version of OS X:

http://www.entropy.ch/software/macosx/php/

If you have questions, let me know. Marc is usually a really helpful guy too, but make sure you read his FAQ before bothering him!!!

(I should also note here that this method of installing PHP is easy only because Apple makes sure that OS X is the same on every Mac. It usually takes much longer to install on Linux/FreeBSD/OpenBSD systems as you have to find the right version for your distribution. This is yet another leg up we have on the Linux guys, but don't rub it in too much. They mean well and at least they're not using Windows!)


More information / Further Reading

I'll write another tutorial soon on how to start actually using PHP. Until then, if you want to learn more, check out PHP.net - the homepage for the language. The aforementioned PHPmac is another good site.

If you're looking for something in actual hard-print, I'd recommend PHP and MySQL Web Development, by Luke Welling and Laura Thomson. It's a great book that's recently been updated to the 2nd edition for the ever changing state of affairs of the Internet. It reads pretty easily and doesn't get you lost in technospeak mumbo-jumbo like some books do. (Incidentally, stay away from the PHP Black Book unless you actually LIKE technospeak and much more information than you need to know).


Feedback and Such

I hope this article was helpful to some people. If so, let me know and it'll give me more motivation to continue writing stuff like this instead of the usual inane babbling that I do! Well, I'll still do the inane babbling, it's just that I'll actually also provide something USEFUL once in a while!

Let me know if you have any questions whatsoever regarding PHP, Mac stuff, wearing pants, or babbling inanely.

Any questions regarding fish sticks or ass cannons, please direct to .

May 14 2003, 9:38 AM EDT, by




Comments:
john 5/14/03, 11:20 AM EDT
This article was helpful & I would like to see more. I am a designer trying to learn more about the technical side, so I am very interested in PHP, MySQL and such. Thanks.

Wasabe 5/14/03, 7:21 PM EDT
Wow. a simple question by me to johnahan and he wrote a full page article. i would like to see a tutitorial.

stickman67 5/14/03, 9:00 PM EDT
Well, yes, it's OK. But I like the inane babbling too! Let's not get carried away here, people!

Jonahan 5/15/03, 1:07 PM EDT
You guys are too kind. No seriously, be meaner, like StrongBad or something. Really get on me about stuff. It's the only way i'm going to learn!!!!

Ok, j/k, but don't worry, the inanity (is that a word?) will always be there ;)

Wasabe 5/15/03, 7:41 PM EDT
Ok. If you want us to....
YOU SUCK YOU SLIME CHEWING WAD!
YOUR ONLY PURPOSE IN LIFE IS TOO BE THE SCUM OF SCUM ON THE BOTTOM OF BILL GATES LOAFERS! LOL. J/k

stickman67 5/15/03, 8:56 PM EDT
Oh, Jon Jon, you stinking, pus-filled abcess on the intestinal lining of a scrofulous dog, how could we be mean to you? After all, you're so good to us! ;-)

PS: "Inanity" is a word. It's a very good word. It's only a tiny wee bit different to insanity ... Nurse, the prozac, s'il vous plais! I seem to be regaining my disequilibrium!

Jean Francois 5/17/03, 9:49 AM EDT
Awesome. Please carry on !

Your bro... 5/17/03, 11:52 PM EDT
This stuff is just too funny, I come here for my daily chuckle....

Who ever said that geeks are witless (that is a word, I checked) drones with bug eyes and spittle dripping from their chins....

No one, oh, sorry, never mind....

Jonahan 5/19/03, 8:29 PM EDT
Hehehe too funny....

I can think of only one word to encapsulate this discussion:

Scrumtrulescent.

Simply scrumtrulescent.

Jonahan 5/19/03, 9:03 PM EDT
And yes, that's a made up word ;)



This article is archived, so you may not comment on it.

(The good news is there's always the shoutbox, the forums or the contact form if you're socially-inclined at the moment!)


iMac G5_468x60
MacMini_02

 Site Links
 Deep Thoughts
If you work on a lobster boat, sneaking up behind people and pinching them is probably a joke that gets old real fast.

 Around Da Web
iProng:
iPhone steals show at CTIA Wireless 2007
DLO offers dual cover fashion case for iPod
AT&T received 1M inquiries on iPhone
MacDailyNews:
Ars Technica in-depth review: Apple TV ?impressed all those who touched it?
Inside Apple?s Mac OS X 10.5 Leopard Server OS
The chips inside Apple TV
Think Secret:
Adobe Creative Suite 3 pricing revealed
 Olde Stuff
2 Guys Podcast Feed
Greatest American Hero
iAir
Scary Ballmer
Space Game
 We Like:
 • 2 Guys
 • Apple.com

 Side Projects
Jonahan
  • JediPoker.net
  • Jonahan.com
  • iProng
  • MacProng
iKen
  • MacIdiot
Jedbeck
  • Jedbeck.com
J.P.
  • Baby Ashley Project