The Best Way to Learn PHP
basix

The Best Way to Learn PHP

Tutorial Details
  • Language: PHP
  • Difficulty: Beginner
This entry is part 1 of 5 in the The Best Way to Learn… Session
Next »

Learning something from scratch is almost always an arduous affair — you simply have no idea as to where to start, or not to start, to kick things off. I loathed learning about the idiosyncrasies of C++’s syntax when all I wanted to learn were some darn programming concepts. As I’m sure you can agree, this is a less than ideal situation.

This is where the Nettuts+ “The Best Way to Learn” series comes into the picture. This series is intended to be your blueprint, your road map, your plan of action for learning your topic of choice! You don’t have to worry about finding the best resources, sorting out the bad ones, and figuring out what to learn next. It’s all here. Just follow it, step by step.

Today, we’re going to figure out the best way to learn PHP.


Assignment #1: Disregard the Naysayers

If you’re reading this, chances are that you’ve Googled a lot to decide which language to learn and how. And without a doubt, you must have run into a ton of articles about how language X is so much better than PHP – and PHP is going to die through obscurity soon.

Haters gonna hate!

As the popular saying goes, haters gonna hate! PHP has been at the helm of the web as you know it and that’s for a very good reason. It’s a mature language, has excellent documentation and a massive number of learning resources along with a great variety of utilities built around it.

And let’s not forget the sheer proliferation of hosts and frameworks PHP has spawned. Like Heroku like hosting? Don’t worry, there are a number of excellent options for PHP as well!


Assignment #2: Install PHP through [X]AMP

Tut image

You could just install PHP but it gets quite boring without a server and some sort of database to play around with. And as a beginner, it’s not really trivial work to get all of these installed and configure each to work with the others without issue.

This is where you grab a package such as XAMPP. These life savers typically install Apache, your web server, along with mySQL, a database system along with PHP significantly cutting down on set up time.

Bonus points if you’re the code monkey type and install everything by hand.


Assignment #3: Learn the Fundamentals

Before I send you off to alternate sources for PHP enlightenment, let me first refer you to our very own series for absolute beginners from none other than your favorite editor, Jeffrey Way.

In this series, over the course of 40+ screencasts, everything from installing PHP to variables, from functions to working with MySQL is covered.

You won’t find a better introduction to the PHP language than this series, and, while it’s unfortunately not free, you can subscribe to Tuts+ Premium for a mere $19. It’s absolutely worth it!


Assignment #4: Sign up with Khan Academy and Lynda

Tut image

Khan Academy may sound like an odd choice since there are no PHP lessons in there but trust me, it’s a good choice. What you can’t find in pure PHP, you can find in the basic of programming. For example, if you’re new to the entire programming hoopla, this is a great place to start.

Another great place to start is Lynda. Here at Envato we have immense respect for those teaching there — the content is usually top notch and cover their topics well. And they cover a vast range of topics as well. If you need a specific lesson, this is where you should begin.


Assignment #5: Read a Few, Good Books

The videos should give you an very good springboard, but, hopefully, hungry for more knowledge. The below books should give you a more elaborate introduction and lots of varied topics for you to devour.

If you feel bored reading the initial portions, good, just skip ahead to the portions where your head hurts.

Nettuts image

PHP Solutions: Dynamic Web Design Made Easy

Author: David Powers

“So why another PHP book? Well, not everyone who uses PHP is a programmer. PHP is the most common dynamic web language used by designers, if their web sites require dynamic functionality, and there are hordes of novice users who want to set up dynamic web sites.”


Nettuts image

PHP for Absolute Beginners

Author: Jason Lengstorf

“PHP for Absolute Beginners starts at the very beginning stages of web programming, showing even the most inexperienced web developer, through examples, how to build a basic content management system. The book dives directly into writing web applications with accompanying explanation rather than explaining elements of the language and then showing examples.”


Nettuts image

PHP Cookbook

Author: Adam Trachtenberg

“PHP Cookbook has a wealth of solutions for problems that you’ll face regularly. With topics that range from beginner questions to advanced web programming techniques, this guide contains practical examples — or “recipes” — for anyone who uses this scripting language to generate dynamic web content.”


Assignment #6: Create Something Simple

This is the perfect time to build something simple with your new found knowledge.

Alright! With all those information swirling inside, you should feel like a rockstar. If not, don’t worry, it’s completely normal. Talk to me later so we can share notes about how daft we feel.

This is the perfect time to try and build something simple with your new found knowledge. It’s best to not try to build something too complicated and fail though — it’s a lot more disheartening than you’d think. Imagine being rejected for the first time. Now multiply it by a few hundred and you’ll be close.

Since you’re just starting out, play it safe and build something absolutely basic like a CRUD app. Nothing major — a few inputs and an ‘uncool’ table to display saved results. This tiny exercise will test your knowledge of a lot of PHP basics including the much vaunted ‘interfacing with a database’ skill.


Assignment #7: Create Something a Little More Complicated

Feeling better now? You should! You gazed upon where there was naught and said ‘This won’t do!’ and created something from scratch. If it were me, I’d be pumped. Let’s use it to extend our knowledge a little more.

While a simple CRUD app is a great start, you’d ideally need more complicated. A simple login/user system is absolutely great for this.

You get to learn how sessions work, how basic authentication is done, how to implement basic security measure and a ton more.

Note: If you’re in need of a little guidance, start here.


Assignment #8: Try out a Lean, Lightweight Framework

Tut image

At this point, after creating a non-trivial system, you probably have noticed how repetitive some of the work is. Why the heck do you need to write your own sessions class or work on hashing passwords yourself? The answer, my friends, is to go with a lightweight framework.

A framework abstracts a lot of the repetitive, boilerplate features in your typical application thus freeing up your brain to actually getting things done.

Note: Not to toot our own horn but we have an immensely thorough session that covers almost all of the important parts of CodeIgnier, a very lightweight, yet powerful framework. If you prefer Kohana, we do that too!


Assignment #9: Try out a Full Stack Framework

Tut image

Now that you’ve been with a lightweight framework, you can now check out the alternate path — a full stack framework. A full stack framework typically ships with a lot more features including code generators, ORMs and an inbuilt server. An excellent choice would be CakePHP — the PHP equivalent of Rails.

The reason you need to check these out later is because there is a lot of ‘magic’ going on. Without a solid understanding of how lightweight frameworks work, it’s hard to really dig into the better featured ones since you’ll mostly be lost and won’t understand how things work.

Note: The Nettuts+ team recommends both FuelPHP and Laravel as top-notch, modern PHP frameworks.

Additional Reading


Assignment #10: Build Something Awesome

With all that information behind you, giving you Indiana’s swagger, now is the time to build something truly awesome. This is the final destination for PHP nirvana — and the choice is up to you.

So what exactly should you be building? Here are a few ideas:

  • A blog is always a safe option. There are a ton of open source solutions for you to get inspiration for the software architecture and the functionality requirements are unambiguous.
  • It’s a little old school but a discussion board is another excellent choice. Moderator rights and post counts, ahoy! If you need a little guidance, this tutorial is a great place to start.
  • Or if you’re too hip for any of these, build yourself a project management application or even just a todo list. They’re always fun to build and you’ll almost always end up using it personally.

Of course, there are just suggestions. No one is stopping you from building a multi-user, realtime chatroom or a service which receives input from random internet strangers and lights up stuff in your room. No one’s judging, go crazy!


Assignment #11: Advance into Development Eliteness

Development is as much about the workflow as much as it is about the code.

Development is as much about the workflow as much as it is about the code. Recently, a typical developer’s workflow has been massively improved by version control as well as platform as a service solutions.

Version control, as expected, frees you up from having to manage revisions manually while PaaS solutions save you from having to do a lot of sys admin work just to get your app to scale.

Resources for the latter are a bit hard to find but here is an excellent screencast on getting started with Git.


Assignment #12: Get Involved and Be Up to Date

New techniques and tools are being introduced everyday.

The web development industry is rarely in a state of equilibrium — everything is changing all the time. New techniques and tools are being introduced everyday and it’s important that you not only read about them but also start contributing.

Find a little glitch in some framework? Submit a patch. Added some new functionality? Patch away! These not only earn you good karma but also valuable points on your resume.

And, oh, about the keeping up to date stuff? Subscribe to our feed and follow us on Twitter and I promise you’ll know all you need to know!


Assignment #13: Keep an Open Mind and Explore

Tryruby

Even though that you are a master of the PHP domain, you can’t afford to, or shouldn’t, rest. PHP is a grand language but that doesn’t mean that it does absolutely everything perfectly.

There is an ever increasing number of new languages out there each adding their own spin to solving a very specific problem that you simply can’t afford to miss out on. And learning something new something doesn’t really wipe out knowledge gained earlier does it? Well, except Star Wars, of course. Those new movies were a crapshoot.

Ruby, Python and Clojure are some of the languages that I’m constantly amazed by and I think they deserve your attention as well. Neither of these languages are necessarily ‘better’ than PHP but each of them do things their own unique way and you owe yourself a chance to take a look and find out whether that approach is for you. While we’re a bit low on Clojure related content, we do have excellent tutorials on Ruby and Python right here.


Conclusion

Well, this is the end of the road, partner! Hopefully, this plan can help you become a PHP master and, indeed, take over the world.

If you feel that I’m missing some obvious resources here, feel free to yell at me in the comments section below and I’ll update this article whilst crying silently. Thank you so much for reading!

Siddharth is Siddharth on Codecanyon
Tags: basix
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://www.wobblyshop.com WobblyShop

    Great article. BTW — the first two books link to the same thing.

  • http://www.markupwiki.com Ashish

    Great article Siddharth! Specially the compilation of books, thanks for sharing with us

  • http://www.psdchat.com Marijan Petrovski

    I remamber through college the PHP Cookbook use to be my best friend.

  • Elegant Rao

    An excellent article.

  • http://www.webflysoftware.com adumpaul

    Some of the best PHP tutorials/sites/resources/books or blogs can help to learn PHP ?

  • http://funnyfail.org Funny fail

    Great article! Going to be studying PHP next semester at college.

  • Richard

    I recommend checking out Larry Ullman’s PHP books and also when you’re ready for OOP a must read is Matt Zandstra’s PHP Objects, Patterns, and Practice.

    Larry’s website (www.larryullman.com) also has a great introductory series on the Yii framework.

  • http://dan.cx/ Daniel15

    Your Kohana tutorial is VERY old and covers Kohana 2.3. There’s been a lot of change in Kohana since then and quite a few versions have come out since then (2.4, 3.0, 3.1, 3.2). Notably, the 3.x series is quite different from the 2.x series.

  • SiT

    I learned to code in Java before PHP, there’s no secret to learning a language, you need to understand what are datatype’s, conditional’s and loop’s then OO. Once you know that every language is a snap, all you need to learn are the specific things that make it different.

    Design pattern’s eventually once you have a good grasp.

  • Yan Geema

    Hi,

    ThanQ for an excellent article.

    A small typing error:
    The Amazon link to the book “PHP for Absolute Beginners” is wrong (points to the previous book in the list).

  • http://blog.xenodesystems.com/ Manuel Escudero

    Do one of these posts but for PYTHON please please please!!! :D

  • http://utibeetim.com Utibe Etim

    I took time out ton read the article and I have learned a lot. Am still creating my database and will soon start PHP programming.

  • http://www.psdbook.net lee

    i am wanna learn php, but i don’t know where to begin, thank u for your tut, i have bought a “beginning php and mysql from novice to professional ” by w,jason gilmore, how about that book? should i learn from it?(sorry for my poor english) thank u.

  • http://www.riak.uk.com Web Design Crawley

    Great Article! thanks for the tips. that 1st book you listed though is outdated. there is a 2nd edition!

  • Tamona

    Keep up the good work, BEST SITE EVER!

  • chamara

    http://www.phpacademy.org is the best way to learn php…

    • http://twitter.com/phil_c64 Phil Clayton

      Thanks a lot fo the link.

  • iFaraja

    Great post,for total absolute beginner don’t forget to get quick tut’s on http://www.w3schools.com,Cheers!!

  • http://webdevelopergeeks.com webdevelopergeeks.com

    great article!! I followed the same process that is listed. You have given some nice books that are very useful. Thanks a lot…

  • http://eways.ph Eways

    this article is great. I’m just on assignment no. 8, good list and probably deserved a bookmark.

  • http://nuthan.in Nuthan

    cool article for beginners and fickle minded……

  • http://www.kezber.com Montreal Web Design

    I don’t recommend using Ruby on rails when you just started learning PHP. Very good guide anyway.
    Getting a good IDE is a very important factor in learning as well, at least it was for me back then. So much easier than coding with notepad, ahh the good old days :)

  • keith

    fuck this is exactly what i needed!!!!

    Thank you so much! i wasn’t sure what the processes of the entire learning journey looked like, but this definitely gives me a better picture!

    • http://www.fahidmohammad.in Fahid

      Try not to use words like f*** in this portal.
      be more professional or alteast act like one…

      Sorry if my comment offended your feelings.

      Fahid

      • http://www.facebook.com/danieldonche Daniel Donche

        Don’t censor him. That’s unprofessional.

  • keith

    Would you be able to provide us with a tutorial on making a project management site?
    “Or if you’re too hip for any of these, build yourself a project management application or even just a todo list. They’re always fun to build and you’ll almost always end up using it personally.”

    I think that would be extremely useful and applicable to many programmers!

  • http://webmanden.dk Claus Hansen

    Very nice article :-)

  • http://feryardiant.web.id Fery Ardiant

    Thanks for the excellent article,
    nice work.. :D

  • http://www.speedydan.co.uk Dan Temple

    I always struggled with learning php… I couldn’t get to grips with why you would use it! It’s only when I found myself in a position of needing to loop through some data, that i started to really understand it! This is a really helpful list!

    Get WAMP (or LAMP) installed and just start experimenting!!

  • Jassim Makki

    Thanks a lots. I am learning so much from this site.

  • http://www.iwebprovider.com Innovative Web Provider

    You’re awesome! Thanks for this. This article is the best, the same with the author

  • http://www.xponics.com Kevin

    Thanks for the article – I’m just starting to learn PHP and this is a great jump off point!

  • http://galtlinedesgin.com Joomla Real EState

    Nice Article and thanks for sharing. I am going to start now and work it hard for the next six months

  • http://www.cbil360.com James Smith

    Excellent information provided here about Web Development that i like most. From your tutorial blog new PHP beginners starts easily learning Web Programming. Thank you for your valuable posts.

  • ivan

    Great share!

    Here is a link to the BEST PHP video tutorials online:
    http://world-shopping.org/products/software-video-lessons/learn-php-in-17-hours/

    Good Luck!

  • http://www.thewwwdesigners.co.cc/ Anirudh

    thanx for the book list….nice article

  • http://www.shameonjane.com shameonjne

    this is very good i am impressed with this. Thank you

  • http://www.leasedup.com leasedup

    Great article. I have been looking at online courses as well thought. However I am stuck on deciding. I think I am just going to have to dive right in to something. Thanks for the book recommendations. I hope I can get something up and running with my new PHP skills soon. :)

  • http://www.eblix.com.au/ Jessdixon

    Great stuff….. Useful to do list for beginners…

  • http://mywayhelpyou.blogspot.com Bilal

    GR8 artical…. WOW….:-)

  • Dey

    Dear Friends,

    I am a network professional, I want to learn web design and start with PHP & MySql.
    Please suggest me some good online courses, from basic to advance.

    Thanks

  • Praveen

    Can anyone focus some light on the security issues related with PHP !!!

  • John Chijioke

    Great Compilation! But I must add that putting myself in the shoes of when I was just getting started with programming this will daze a newbie. It’s better to start out controlling the expectations of your visitor to the fact that this is just a link to resources. Also they should be advised to read through probably several times before they touch a single link unless they know what they are doing so as to get a hang of the path you want them to go through in their search for php knowledge. But nevertheless, great write up and thank you.

  • http://technosphere.tk Tauquir Ahmed

    Also, using PHP IDE like netbeans help beginners alot

  • http://student ronsokchim

    phreak hou pagoda

  • zakius

    frameworks are devils incarnations -.-

  • http://takdid.com reza

    I have started to learn php. this is my third week.
    I wish to learn as a good student.
    thank you for writing this road map.
    also I love php and WP together.

  • http://webdesignerbd.com Faisal

    i need to start with Assignment#10……

  • Lucas

    Great article!!!

  • http://www.mimeocreative.com.au/ Phil@mc

    The book ‘PHP for absolute beginners’ is terrible. Riddled with untested, broken code that will drive you insane. Avoid++.

  • http://androidproapps.com Sinbad Konick

    I really liked the Article …It’s really great..I want to recommend something to the tutsplus..in net.tutsplus i want to see a article same like this but On HTML .. :) Hope to see it soon..

  • Kent

    You can find more than 300 pages worth of php tutorials at More php tutorials

  • Koen

    Like what you did here man!