17 WEBSHOP [web design & development] +1 (940) 343-5183  

Webshop Blog

3

PHP From The Top: 1 (Getting Set Up)

PHP Elephant Logo

This is going to be the first article in this “PHP From The Top” series that I am going to be writing. I will be covering PHP basics, all the way up to some OOP concepts and applications, and hopefully some more advanced topics as time goes on. I figured today we would begin with a bit of a primer into what PHP is and what it is used for. This series will assume that you atleast have a basic understanding of (x)HTML and CSS (CSS used will not be crucial in most cases and will therefor not be focused on). Let’s get started!

Other Posts in this Series

Introduction

PHP is a scripting language most often used for programming on the web and the development of dynamic web pages and applications. It is a server-side language (which means that the code is executed on the server before it is sent to the user’s browser), this is in contrast with other scripting languages such as Javascript which are actually executed on the user’s browser after the page is loaded. PHP is executed before the page loads.

Behind the Name “PHP”

The acronym “PHP” originally stood for “Personal Home Page,” but as the web has evolved the meaning of the name has since changed. “PHP” now stands for “PHP: Hypertext Preprocessor,” which actually is quite odd in and of itself as the acronym is recursive–that is, the first “P” in “PHP” actually stands for “PHP” and the first “P” in that second instance of “PHP” also stands for another instance of the same acronym “PHP,” and continues indefinitely.

Why Should I Learn PHP?

Any modern day web developer, or hobbyist even, should have at least a basic understand of what PHP is and how PHP works. More than 19 Million websites are built on PHP code, many that we visit every day including: Facebook, Yahoo, Wikipedia, Flickr, Digg, any blog using wordpress, etc… And there are a lot of reasons why so many people choose to use PHP over other scripting languages.

Okay, so what can PHP do for me? Web pages written in HTML markup are static. The state of the page, and any info on the page cannot change without editing the file, and saving it again.

  • PHP works seamlessly with HTML. Your PHP code can actually output HTML code–right along side your existing HTML. The two just work together.
  • PHP offers excellent integration with MySQL. If you are unsure of what this means, don’t worry. We’ll get to it over the next few articles.
  • PHP has a strong working user-base. What does this mean for you? It means that when you have problems and need answers. There are a lot of people that can help you.
  • PHP is open-source. Which means, it’s free!

What Do I Need to Get Started?

All you need to get started with coding in PHP is a simple text editor and a server with PHP installed and running on it. Nearly every hosting company should offer PHP installed on their servers. However, if you’re working locally, which is what I’ll be doing, you will have to install PHP and an Apache server on your computer. This can be more difficult than one might think, so the solution that I recommend is to install a WAMP or MAMP package, depending on what operating system you are working on. WAMP and MAMP are both package local-hosting environment solutions. They combine, Windows (or Mac OS X) with Apache, MySQL, and PHP installations.

As far as text editors go, you could use Notepad (one Windows) or TextEdit (if you’re on a Mac)–I mean, those will work… However, you may want something with a few more helpful features such as syntax highlighting for better code readability, code folding, inline “auto-complete” typing aids, etc… If you’re using Windows, might I recommend using Notepad++ and if you’re using a Mac I suggest trying out Text Wrangler. There are many other options-countless options, and many of them can get quite expensive, but the two I listed here are free to use.

Well, that about wraps up today’s first installment on how to get set up and running PHP on your machine, so you can start learning it. I would have liked this first article to go into language basics (at least). But I feel like I couldn’t start a learning series without an initial set-up guide. Next time we will begin going over the actual PHP language basics and understanding how it all works.

 

Leave a Response

Use the <code> tag for code.

 

3 Responses to “PHP From The Top: 1 (Getting Set Up)”

  1. All you need to get started with coding in PHP is a simple text editor and a server with PHP installed and running on it. Nearly every hosting company should offer PHP installed on their servers. However, if you’re working locally, which is what I’ll be doing, you will have to install PHP and an Apache server on your computer. This can be more difficult than one might think, so the solution that I recommend is to install a WAMP or MAMP package, depending on what operating system you are working on. WAMP and MAMP are both package local-hosting environment solutions. They combine, Windows (or Mac OS X) with Apache, MySQL, and PHP installations.

  2. @Kerry, try out XAMPP. Its a package similar to MAMP and WAMP but its cross platform. And yes, KWrite is great!

  3. Kerry says:

    What about if I’m using a Linix distro (Slax is the coolest live CD ever! Check it: slax.org)? Is KWrite decent enough to get started, or should I scour the net for another text editor? If so, any recommendations? Also, glad to see you blogging, buddy! Feel free to put a banner ad on thefbm (hopefully it will be full swing here in a few days, so it might help a tiny bit). Rock on!