DEV Community

adewaleK
adewaleK

Posted on

Beginners Guide to PHP

PHP is probably the most popular scripting language on the web. It is used to enhance web pages. With PHP, you can do things like create username and password login pages, check details from a form, create forums, picture galleries, surveys, and a whole lot more. If you've come across a web page that ends in PHP, then the author has written some programming code to liven up the plain, old HTML.

PHP is known as a server-sided language. That's because the PHP doesn't get executed on your computer, but on the computer you requested the page from. The results are then handed over to you, and displayed in your browser. Other scripting languages you may have heard of are ASP, Python and Perl. (You don't need to know any of these to make a start on PHP. In fact, these tutorials assume that you have no programming experience at all.)

The most popular explanation of just what PHP stands for is "Hypertext Pre-processor". But that would make it HPP, surely? An alternative explanation is that the initials come from the earliest version of the program, which was called Personal Home Page Tools. At least you get the letters "PHP" in the right order!

But PHP is so popular that if you're looking for a career in the web design/web scripting industry then you just have to know it! In these tutorials, we'll get you up and running. And, hopefully, it will be a lot easier than you think.

                  What you need to get started with PHP

Before you can write and test your PHP scripts, there's one thing you'll need - a server! Fortunately, you don't need to go out and buy one. In fact, you won't be spending any extra money. That's why PHP is so popular! But because PHP is a server-sided scripting language, you either have to get some web space with a hosting company that supports PHP, or make your computer pretend that it has a server installed. This is because PHP is not run on your PC - it's executed on the server. The results are then sent back to the client PC (your computer).

Don't worry if this all sounds a little daunting - we've come across an easier way to get you up and running. We're going to be using some software called Wampserver. This allows you to test your PHP scripts on your own computer. (The WAMP of Wampserver stands for Windows, Apache, MySQL, PHP.) It installs everything you need, if you have a Windows PC. We'll explain how to get it installed in a moment, and where to get it from. But just a word for non-windows users.
Apple Users

For Apple use, MAMP is quite good. Like Wampserver, it installs everything you need for this course. You can download it from here:

https://www.mamp.info/en/

What you're doing here is getting the apache server up and running so that you can run PHP scripts offline. Pay particular attention to where files are stored, and to the "localhost" address.

Linux Users

There are quite a few sites out there to help Linux users get up and running with the Apache server and PHP. Unfortunately, there's no easy way like there is for Windows and Mac users. You best bet is to Google your distro with the following:

Lamp +Ubuntu

Or

Lamp +Debian

There's also quite a few YouTube videos that will help you instal everything you need.

Windows Users

OK, back to Wampserver and Windows. First, you need to download the software. You can get it from here (this site is nothing to do with ours, by the way):

Download Wampserver

In the next part below, you'll see how to make sure eveything is set and running with Wampserver.

Top comments (2)

Collapse
 
das_01 profile image
Okwong Okwong

where is the next part?

Collapse
 
supunkavinda profile image
Supun Kavinda

Take a PHP Tutorial. Here are some of them.