How to Start Learning PHP

First of all, you need to ask your self. Do you have the prerequisites to learning PHP? Some one once told me “think of PHP as a tool that will write HTML for you.”

Here’s what that means: the web is still made of HTML. You and your browser still mostly only see HTML. PHP does its work in the back-end. In the server side.

Once you get to know PHP, this will make more sense to you.

But, since PHP is a tool to help you dynamically create HTML, you need to know HTML and CSS well before you delve into PHP. These two are definite prerequisites to PHP.

Other scripting languages, such as SQL, Javascript, and XML are nice to know, but you could learn these along the way with PHP.

Furthermore, programming languages are kind of like spoken languages in that you may become fluent in a language and very capable of using it without really learning its grammar. However, if you don’t learn the grammar well enough, you will sooner or later make mistakes. And when you make mistakes with computers, they don’t just get confused and let it slide; they cause problems. So, I’m not gonna tell you that you need to have all the basics of Object-Oriented-Programming in order to be able to learn and use PHP proficiently, but it would help you a lot to understand objects, functions, variables and these kinds of programming basics.

So, are you ready to learn PHP?

Here’s what you need…

You need to be able to be able to execute PHP code on your local machine/PC. This will allow you to learn much faster and more conveniently.

To run PHP on your local machine, you are going to need the stuff that PHP requires, like an Apache server, maybe also MySQL database and email support…You can install each one of those individually. Or…there is an easier way!

If you are starting from a clean slate, my advice is that you download XAMPP.

Here’s why XAMPP is great for someone who wants to learn PHP:

  • It’s free
  • The installation process of XAMPP is idiot-proof
  • Once you are done with XAMPP’s easy installation process (a couple of clicks only), you will have everything you need to run PHP on your local machine (Apache, MySQL, phpMyAdmin, Mercury Email)
  • XAMPP is widely used and supported

Download XAMPP Here

After you have downloaded and installed XAMPP, you are ready to try PHP.

A great place for a newbie to start learning PHP (and every scripting language related to the web, including HTML and CSS) is Go through their PHP tutorial section by section. But only try to learn the basics. Don’t delve in too deep…Here’s the reason:

As a beginner, there is no reason to try to learn every single vocabulary in the language. You will overwhelm yourself and get discouraged. In the end, you are only gonna use a fraction of the entire collection of vocabulary. Therefore, only learn the minimum required to get you started. From then on, the easiest way is to learn by example. Use the sample code on and all the PHP code that is freely scattered across the Web to construct solutions to your own coding challenges. Pretty soon, you will be able to make your own code from scratch. When you come across code that you don’t understand, check a few reference websites to see if the functions or coding techniques are explained. is THE reference website for PHP. All of PHPs functions are explained there; just search for them.

Another tip: break down any programming challenge to it’s smallest piece. Then keep adding the pieces together to create your software. For example, if your programming challenge is to get PHP to take the content of a text file and output the content in an HTML table. Your first task here is how to get PHP to read the file. That’s it. Learn that first. Then learn how to store the content of the file, how to retrieve it, and how to organize it, etc.

That should be enough to get you started. If you need personal hand-holding, you might wanna visit some of the active PHP online communities and interact with the people there. A great place to start is PHP Freaks Forums.

Good luck!


7 thoughts on “How to Start Learning PHP

  1. Ashutosh says:

    Thanks sir, excellent advice. I am a .net guy, but i feel i am not gonna work on it for more…. Php sounds a good choice.

  2. Thanks! This was just the guide I was looking for. Good thing for Google picking it up and displaying on the first page.

  3. Mike says:

    Thanks! for the information provided..but how come other schools requiring to learn Javascript first before taking up PHP? While some requiring HTML, DBMS, and some HTML and CSS. I just don’t get it..anyway I am really determined to learn this PHP and MYSQL. For me building websites through html and css is not enough to build a successful career in this field. I am a graphic designer for 8 years and decided to widen the horizon of my career. I tried to apply for the position of web designer but I just don’t have the luck I just assumed that my knowledge is not yet enough for me to be qualified since working on prints is a bit different to web. Right now I just finish my first website through wordpress and I have learn a lot with html and css and I may say it’s very enjoying. My next target is to learn php and mysql..I’m planning to take a short course in school for 3 -5 days and I’m hoping to finish a lot of projects after taking this up.

    • M.K. says:

      JavaScript and PHP are not directly interdependent. It doesn’t matter which one you learn first. Each one can be useful on its own.

      Good luck with your plans and adventures with web development. WordPress is a great choice!

Comments are closed.