20 Best PHP Books For Web Development

Resources Web Development This post may contain affiliate links. If you buy something we get a small commission at no extra charge to you. (read more)

The largest and most popular web programming language has to be PHP. It’s been around since the 90s and has powered the majority of popular websites including Digg, Facebook, and every WordPress blog you know.

Learning PHP is usually the first step in programming for the web. There is a lot to learn but you can shave off some time by finding the right learning materials. To help I’ve curated my top picks for the absolute best PHP coding books to take you from a complete novice to a skilled professional in no time.

Best Newbie PHP Book

If you want one resource that’ll take you from beginner to expert then you want PHP and MySQL Web Development. It’s extremely long with over 1,000 pages but it covers absolutely everything you’ll need to know for web development with an easy-to-read format.


Programming PHP: Creating Dynamic Web Pages

To start the O’Reilly Programming PHP book is an excellent resource for beginners. It’s 540 pages long and currently in its 3rd edition with many updates for the fundamental PHP features (not counting PHP7).

This works well for beginners because it covers the concepts rather than the minute details. It’s an excellent resource to learn more about PHP and how it has grown as a language. I specifically recommend this book for anyone new to backend coding in general since the first chapter covers the absolute basics of server-side code.

Throughout these pages you’ll also learn common coding terms like arrays, functions, variables, and some basic database tools.

This intro book is on the cheaper end so it’s a great investment if you’re looking for a detailed intro to the web’s most popular language.


The Joy of PHP

Some developers prefer a lighter introduction and The Joy of PHP fits this mold perfectly.

The author Alan Forbes approaches PHP from a very practical stance. He explains things logically but also uses live examples and sample projects to help you learn along the way. This book is a bit shorter than most so it’s also not as dense.

But the quality of writing makes this information easier to absorb no matter what kind of coding background you have.

You’ll learn how to setup a local server, install PHP, write a basic script and even run some SQL queries. An excellent guide for newbies who feel uncertain of where to start.


Learning PHP 7

The buzz around the watercooler is all about the PHP 7 release. This is the latest version of the PHP language and it’s set to radically improve speed and performance on all servers.

With the book Learning PHP 7 you’ll dive into 400+ pages of new PHP 7 concepts and coding techniques. However be warned this is still a beginner’s book and it’s not a great choice for semi-experienced coders.

PHP 7 does not have that many changes code-wise. It’s more of a restructuring with the backend and how memory, objects, and classes are handled. This is still something you’ll want to study but I’d only recommend this book for beginners who want to start off with the freshest material.

Exercises are incredibly simple to follow and this book actually makes coding fun!


Modern PHP

I will say the Modern PHP book is a bit more detailed than typical beginner books. It covers namespaces, objects, classes, and security concerns in great depth.

This makes it the perfect choice for developers looking to up their game right away. Most web developers know that Google is the ultimate problem solving tool. If you know how to Google your questions then Modern PHP is a decent choice for beginners.

But the intermediate-level coders will get the most from this book since many topics go deeper than surface level concepts. You’ll learn about Facebook’s HVVM methodologies and how Facebook’s code has changed the PHP ecosystem.

Whether you’re building a custom SaaS app or editing a WordPress framework, this book will help you learn whatever you need and go a bit further.


Learn PHP

For a simple laid-back intro to PHP you should check out Learn PHP by Bruce Berke. This cheap guide to the programming language follows a simple writing style that appeals to everyone.

It’s also written to help answer common questions and provide the easiest solutions to common problems.

If you’ve never written a line of code in your life this book is a great intro. It’ll teach you how to plan out your programs and how to decide when to use certain loops or GET/POST requests. The very later chapters touch upon coding standards & security which are important for beginners.

I can’t say this’ll take you up to expert territory. But it’ll definitely get you past that early phase when the whole programming language seems alien and impossible to understand.


PHP and MySQL Web Development

Every great website typically has a database and MySQL is the most common. PHP and MySQL Web Development is a primer on both topics made for fresh programmers who want to dive head-first into this ecosystem.

If you’re gonna learn PHP then you eventually must learn MySQL. Truthfully it’s no different than all other SQL databases, however it’s widely supported on most PHP servers and it has become the default choice for web development.

This book is absolutely massive spanning a total of 1,000 pages long. Yes, over one thousand pages.

Early chapters explain PHP from start to finish and quickly move over to MySQL. Then you learn how to build websites that rely on PHP/MySQL for user data, page content, and even user submissions.

I admit this book can feel intimidating to beginners. However I also think it’s the best way to learn PHP for web development because it covers the language and the ecosystem together in one package.


Head First PHP & MySQL

Another relevant book you might like is Head First PHP & MySQL by Robin Nixon. This is still a massive title with over 800 pages chock-full of PHP goodies.

The writing style is a bit easier to read so it may pertain better to newbies who want a quick dive into PHP development. But the lessons are just as detailed so you’re still learning by studying real-world scenarios and applying what you learn with each new chapter.

Topics include user sessions, cookies, database connections, and securing user input among many other subjects. The teaching style relies on lessons so if you’re willing to pound your keyboard you’ll learn a lot from this book.

I’d say this is one of the best intros for complete beginners but especially so for devs using PHP for custom websites.


Learning PHP, MySQL & JavaScript

Adding one more language into the mix is the book Learning PHP, MySQL & JavaScript. This covers backend PHP/SQL along with frontend JavaScript to create custom Ajax web apps.

Because of newer libraries like React.js these techniques may be a bit outdated. However that’s only true if you want to build dynamic single-page apps without using PHP classes.

Anyone willing to learn traditional coding should absolutely learn the basics of JavaScript and Ajax. This book covers it all in spades including regular expressions, JS security, and error handling with PHP/JS.

Great all-around book if you’re trying to learn PHP webdev from scratch.


PHP Cookbook

Here’s a book I recommend keeping on your desk or nearby on your bookshelf as a reference. The PHP Cookbook spans a massive 820 pages with solutions for developers of all skill levels.

Please note this is not meant to teach you PHP from scratch. Instead it’s a recipe book to help you solve common problems with quick solutions.

Through this process you often learn more about PHP and what it can do. But this is not strictly a PHP learning resource and it’s best used by semi-skilled coders who know what they’re looking for.

The solutions are easy to setup and they run through various topics like arrays, forms, and typical object/class issues.

If you’re willing to pick this up I know it’ll help you out on numerous occasions.


PHP Objects, Patterns, and Practice

Object-oriented programming is a must-learn methodology for the web. PHP has finally caught up with newer techniques and the PHP 7 release ensures that more coders will follow this route in the future.

PHP Objects, Patterns, and Practice by Matt Zandstra is the definitive guide to OOP in PHP. It’s a complete guide explaining how to design OOP apps from the ground-up. You’ll learn how to generate objects, run unit tests, and follow strict design patterns for a cleaner workflow.

These design patterns come in handy down the line when you’re trying to edit existing code. You’ll learn both PHP and SQL patterns along with best practices to employ along the way.

This book may be just above the beginner level so it’s not great for complete newbies. But once you understand a bit about PHP I absolutely recommend a copy of this book to help you nail down the OOP practices used by modern professionals.


PHP Solutions: Dynamic Web Design Made Easy

For a lengthy solution-oriented book with a cheap price tag definitely grab a copy of PHP Solutions: Dynamic Web Design Made Easy.

The goal of this book is not simply to cover PHP in a rote fashion. Instead it covers the language in a practical sense, teaching how you can use PHP to create websites that actually do something valuable for the end user.

Currently in its 2nd edition and 500+ pages long this book is a goldmine of information for beginners. You’ll learn what PHP is and how it works, then quickly dive into the action by creating file upload webapps and custom user profiles.

Later in the book you’ll learn about MySQL and creating your own databases. For the price this is an excellent intro guide with a very hands-on approach.


Learn PHP In A Day!

Granted this title may be a bit of a misnomer but there is some accuracy in how fast you can pick up PHP with the right materials. Learn PHP In A Day! is a newer book first published in 2015 with a ton of resources for beginners.

The PHP language has been around for decades and not a lot has changed syntax-wise. But the actual design patterns have changed quite a bit so it’s great to have a guide like this by your side.

And this is a brilliant intro for newbies because it teaches you how to setup a local server and install PHP from scratch. This is crucial knowledge because building websites goes far beyond simple PHP code.

But, of course, later lessons get into the complexities of PHP and how you can use functions/classes to your advantage while writing scripts.

I consider this more theory-oriented but it’s a great intro for complete beginners who want to get moving fast.


Beginning Laravel

Once you learn the fundamentals of PHP you might want to pick up the most popular PHP framework called Laravel. This is an open source project that helps developers create PHP apps from scratch with all the dirty work handled.

This lets you abstract complex ideas like routing, sessions, and cookie management all through a few lines of PHP. Naturally this is a must-have resource for anyone hoping to build quality PHP websites.

And Beginning Laravel is a must-have learning tool if you plan to dive into Laravel from scratch. This book is exquisite covering a lot of ground in just 190 pages.

Every chapter is easy to follow and beginners will have no trouble keeping up. This is my top recommendation for newer PHP coders who want to get moving with Laravel and setup new sites fast.


PHP Object-Oriented Solutions

Another book I recommend for semi-newbie coders is PHP Object-Oriented Solutions. I mentioned earlier how OOP code is imperative for modern web development.

After you dig into this book you’ll realize why it’s so powerful and how you can use this to your advantage. It’s a massive 400 page resource on classes, objects, and the practical application of these features in your work.

Sometimes you’ll want to abstract user functions like signing up to a site or logging into an account. If you follow the lessons in this book you’ll learn how to create these abstractions and clean up your PHP source.

This is not a great starting book if you have zero experience. Try to nail down the absolute basics first before diving into OOP, but keep in mind it’s good to start this sooner than later.


PHP in Action

I’m a huge fan of all the Manning books for their depth, writing style, and accuracy. PHP in Action spans 550+ pages and it’s a brilliant resource for using PHP to create realistic web applications from scratch.

Note this book is definitely old currently pushing over a decade since first release. But PHP isn’t a language that changes too often and the practical basics are always the same.

With PHP in Action you’ll learn about templating, MVC architecture, library files, database content and sanitizing user input(among other topics). All of these are crucial to building any PHP app and they work the same now as they did 10 years ago.

Complete beginners may want a simpler intro before grabbing this book, although if you’re willing to debug your own code along the way this can get you moving fast with PHP.


Building Web Apps with WordPress

WordPress is by far the largest PHP CMS on the web. It’s completely open source which means everyone can use it and customize it for life without paying a dime.

This is why so many PHP developers eventually learn WordPress because it’s simply the best system for content management. Building Web Apps with WordPress is a sweet intro guide for coders who want to learn everything about the WordPress ecosystem.

WP development works differently than most webapps and this book walks you through the process. You’ll learn how to create WordPress themes, plugins, and customize features using the functions.php file.

Make sure you already know a decent amount about PHP before grabbing this book.

It doesn’t hold your hand so it’s geared towards professional developers who want to learn WordPress inside & out.


PHP and MySQL for Dynamic Web Sites

The Visual QuickStart guides always helped me when I was first learning the ropes. And while some of PHP’s features have changed, the fundamental programming concepts have not.

PHP and MySQL for Dynamic Web Sites is currently in its 4th edition pushing just about 700 pages long. This book is an excellent resource for anyone hoping to learn more about the PHP/MySQL dev environment.

Author Larry Ullman has years of experience working with PHP and his writing style is perfect for beginners. Early chapters cover a lot of theory and basic setup but you’ll quickly dive into the action with some practice projects.

Dynamic web development can be intimidating but the writing in this book makes it so much more approachable. If you’re starting from scratch and want a practical guide to PHP and database development then this is the book to get.


PHP Advanced and Object-Oriented Programming

Here’s another book from Larry Ullman and it’s an excellent follow-up to the previous one.

PHP Advanced and Object-Oriented Programming is the definitive guide to professional PHP development. I really like this book for the level of depth and the clear explanations.

By the time you get this book you should already know the fundamentals of the language. But there’s always more to learn and Larry does an excellent job proving this with his simplistic writing style.

You’ll learn about class maintenance, extending existing classes, and working with CMS frameworks to create add-ons that follow their coding standards.

Intermediate-to-advanced coders will learn a ton by leafing through these pages. I strongly recommend this book for anyone hoping to take their PHP to the next level.


PHP 7 Programming Cookbook

One more resource to keep nearby is the PHP 7 Programming Cookbook.

Many developers prefer online resources for code snippets because they can just copy/paste and Google for solutions. But with cookbooks you also have direct access to some of the smartest minds in PHP right at your fingertips.

In this book author Doug Bierer shares code snippets and handy workflows for pretty much everything under the sun. Class replication, unit testing, database table security, and a ton of very detailed topics are all showcased in these recipes.

Each chapter covers a specific problem, then shows you how to solve it followed by an explanation of how it all works together. This offers real solutions along with descriptions to help you learn along the way.


Learning PHP 7 High Performance

Learning PHP 7 High Performance is a truly advanced book for professional PHP developers.

It’s a fairly small book with only 200 pages but it gets into so much detail about server performance and working with this language on professional projects. The author goes beyond PHP to help you understand the server platform and why this is such a huge factor in performance.

You’ll learn how to setup CDNs and how to cache pages locally. Later chapters get into SQL queries and how you can optimize these with certain PHP calls. You’ll also learn how to debug your code and find bottlenecks in performance.

Whether you use WordPress, Laravel, or your own custom framework, this book will help you improve performance tenfold. It’s an absolute must-read for any serious PHP programmer.

For anyone brand new to PHP with zero programming knowledge then The Joy of PHP is a nice place to start. It’s an easy read and should guide you along gracefully.

But if you’re looking for a more detailed introduction you can’t go wrong with either Programming PHP or PHP and MySQL Web Development. Both excellent choices for complete beginners.

As your experience level grows you’ll want to branch into OOP, database optimization, and ultimate higher-level PHP on frameworks like Laravel. This list should offer more than enough resources to help you learn more regardless of your background.


Author: Jaime Morrison

Jaime is a jr. designer interested in mobile UI/UX research and frontend web development with JavaScript frameworks. He covers general news and useful resources in the web design space.