The 18 best PHP books of all time

A data-backed answer

🐘

Methodology

There are countless lists on the internet claiming to be the list of must-read PHP books and it seemed that all those lists always recommended that same books minus two or three odd choices.

Finding good resources for learning programming is always tricky. Every-one has its own opinion about what book is the best to learn, and as we say in french, “Color and tastes should not be argued about”.

However I though it would be interesting to trust the wisdom of the crown and to find the books that appeared the most in those “Best PHP Book” lists.

If you want to jump right on the results go take a look below at the full results. If you want to learn about the methodology, bear with me.

I’ve simply asked Google for a few queries like “Best PHP Books” and its variations of. I have then scrapped all those pages (using ScrapingBee, a web scraping API I’m working on).

I’ve deduplicated the links and ended up with nearly 52 links. Using the title of the pages I was also able to quickly discards:

I ended up with almost 47 HTML files. I went on opening all the files on my browser, open my chrome inspector, found and wrote the CSS selector matching book titles in the article. This took me around 1hours, almost 30 seconds per page.

This also allowed me to discard even more nonrelevant pages, and I discarded a lot. In the end I compiled around 28 lists into this one.

Book titles were then extracted with manuel extraction and some web scraping.

I ended up with a huge list of books, not usable without some post-processing.

To find the most quoted PHP books I needed to normalize my results.

I had to play with all the different variation like “{title} by {author}” or “{title} - {author}”.

Or “{title}:{subtitle}” and “{title}”, or even all the one containing edition number.

And afterquite a bit of manual cleaning.

My list now looked like this:

From there it was easy to compute the most recommended books. You can find all the data used to process this list on this repo. Now let’s take a look at the list:

I've also recently used some data from different book sellers in order to not forget important books and try to give more weight to books with incredible reviews.

Results

18
)

PHP Objects, Patterns, and Practice

by
MATT ZANDSTRA
5.0
% recommend
🛒   Buy
Aided by three key elements: object fundamentals, design principles, and best practices, you'll learn how to develop elegant and rock solid systems using PHP. The 5th edition of this popular book has been fully updated for PHP 7, including replacing the PEAR package manager with Composer, and new material on Vagrant and PHP standards.

It provides a solid grounding in PHP's support for objects, it builds on this foundation to instill core principles of software design and then covers the tools and practices needed to develop, test and deploy robust code. PHP Objects, Patterns, and Practice begins by covering PHP's object-oriented features.

It introduces key topics including class declaration, inheritance, reflection and much more. The next section is devoted to design patterns.

It explains the principles that make patterns powerful. The book covers many of the classic design patterns and includes chapters on enterprise and database patterns.

The last segment of the book covers the tools and practices that can help turn great code into a successful project. The section shows how to manage multiple developers and releases with git, how to manage builds and dependencies with Composer.

It also explores strategies for automated testing and continuous integration. What You'll Learn Work with object fundamentals: writing classes and methods, instantiating objects, creating powerful class hierarchies using inheritance.

Master advanced object-oriented features, including static methods and properties, managing error conditions with exceptions, and creating abstract classes and interfaces. Learn about the new object-oriented features introduced by PHP 7 and why they matter for your code.

Understand and use design principles to deploy objects and classes effectively in your projects. Discover a set of powerful patterns that you can deploy in your own projects.

Guarantee a successful project including unit testing; version control, build, installation and package management; and continuous integration. Who This Book is For This book is suitable for anyone with at least a basic knowledge of PHP who wants to use its object-oriented features in their projects.

Those who already know their interfaces from their abstracts may well still find it hard to use these features in their systems. They will benefit from the book's emphasis on design.

They will learn how to choose and combine the participants of a system; how to read design patterns and how to use them in their code. Finally this book is for PHP coders who want to learn about the practices and tools (version control, testing, continuous integration, etc) that can make projects safe, elegant and stable.
Amazon.com
17
)

Effortless E-Commerce with PHP and MySQL

by
Larry Ullman
5.1
% recommend
🛒   Buy
In this comprehensive guide to creating an e-commerce Web site using PHP and MySQL, renowned author Larry Ullman walks you through every step--designing the visual interface, creating the database, presenting content, generating an online catalog, managing the shopping cart, handling the order and the payment process, and fulfilling the order--always with security and best practices emphasized along the way. Even if you're an experienced Web developer, you're guaranteed to learn something new.

The book uses two e-commerce site examples--one based on selling physical products that require shipping and delayed payment, and another that sells non-physical products to be purchased and delivered instantly--so you see the widest possible range of e-commerce scenarios. In 11 engaging, easy-to-follow chapters, Effortless E-Commerce with PHP and MySQL teaches you how to: * Think of the customer first, in order to maximize sales * Create a safe server environment and database * Use secure transactions and prevent common vulnerabilities * Incorporate different payment gateways * Design scalable sites that are easy to maintain * Build administrative interfaces * Extend both examples to match the needs of your own sites
Amazon.com
16
)

Essential PHP Security

by
Chris Shiflett
5.6
% recommend
🛒   Buy
Being highly flexible in building dynamic, database-driven web applications makes the PHP programming language one of the most popular web development tools in use today. It also works beautifully with other open source tools, such as the MySQL database and the Apache web server.

However, as more web sites are developed in PHP, they become targets for malicious attackers, and developers need to prepare for the attacks. Security is an issue that demands attention, given the growing frequency of attacks on web sites.

Essential PHP Security explains the most common types of attacks and how to write code that isn't susceptible to them. By examining specific attacks and the techniques used to protect against them, you will have a deeper understanding and appreciation of the safeguards you are about to learn in this book.

In the much-needed (and highly-requested) Essential PHP Security, each chapter covers an aspect of a web application (such as form processing, database programming, session management, and authentication). Chapters describe potential attacks with examples and then explain techniques to help you prevent those attacks.

Topics covered include: Preventing cross-site scripting (XSS) vulnerabilities Protecting against SQL injection attacks Complicating session hijacking attempts You are in good hands with author Chris Shiflett, an internationally-recognized expert in the field of PHP security. Shiflett is also the founder and President of Brain Bulb, a PHP consultancy that offers a variety of services to clients around the world.
Amazon.com
15
)

PHP 7 in easy steps

by
Mike McGrath
5.6
% recommend
🛒   Buy
PHP 7 in easy steps will teach you to code server-side scripts. It begins by explaining how to install a free web server and the PHP interpreter to create an environment in which you can produce your own data-driven server-side web pages.

You will learn how to write PHP server-side scripts and how to make MySQL database queries. Examples illustrate how to store and retrieve Session Data, how to provide a Message Board, and how to access Web Services APIs over Hypertext Transfer Protocol.

PHP 7 in easy steps has an easy-to-follow style that will appeal to anyone who wants to begin producing data-driven web pages, as well as to web developers wanting to add server-side interaction to their websites, and the programmer who quickly wants to add PHP to his or her skills set. It will also appeal to the hobbyists who want to begin creating scripts for upload to their own ISP, the student, and to those seeking a career in computing who need a fundamental understanding of server-side programming with PHP.
Amazon.com
14
)

PHP Cookbook: Solutions & Examples for PHP Programmers

by
David Sklar & Adam Trachtenberg
6.0
% recommend
🛒   Buy
Want to understand a certain PHP programming technique? Or learn how to accomplish a particular task? This cookbook is the first place to look. With more than 350 code-rich recipes revised for PHP 5.4 and 5.5, this third edition provides updated solutions for generating dynamic web content—everything from using basic data types to querying databases, and from calling RESTful APIs to testing and securing your site.

Each recipe includes code solutions that you can freely use, along with a discussion of how and why they work. Whether you’re an experienced PHP programmer or coming to PHP from another language, this book is an ideal on-the-job resource
Amazon.com
13
)

PHP Programming with MySQL: The Web Technologies Series

by
Don Gosselin & Diana Kokoska & Robert Easterbrooks
6.4
% recommend
🛒   Buy
This book covers the basics of PHP and MySQL along with introductions to advanced topics including object-oriented programming and how to build Web sites that incorporate authentication and security. After you complete this course, you will be able to use PHP and MySQL to build professional quality, database-driven Web sites.
Amazon.com
12
)

Programming PHP: Creating Dynamic Web Pages

by
Kevin Tatroe & Peter MacIntyre & Rasmus Lerdorf
6.5
% recommend
🛒   Buy
This updated edition teaches everything you need to know to create effective web applications with the latest features in PHP 5.x. You’ll start with the big picture and then dive into language syntax, programming techniques, and other details, using examples that illustrate both correct usage and common idioms.

If you have a working knowledge of HTML, the authors’ many style tips and practical programming advice will help you become a top-notch PHP programmer. Get an overview of what’s possible with PHP programs Learn language fundamentals, including data types, variables, operators, and flow control statements Understand functions, strings, arrays, and objects Apply common web application techniques, such as form processing, data validation, session tracking, and cookies Interact with relational databases like MySQL or NoSQL databases such as MongoDB Generate dynamic images, create PDF files, and parse XML files Learn secure scripts, error handling, performance tuning, and other advanced topics Get a quick reference to PHP core functions and standard extensions
Amazon.com
11
)

PHP for the Web: Visual QuickStart Guide

by
Larry Ullman
7.5
% recommend
🛒   Buy
With PHP for the World Wide Web, Fourth Edition: Visual QuickStart Guide, readers can start from the beginning to get a tour of the programming language, or look up specific tasks to learn just what they need to know. This task-based visual reference guide uses step-by-step instructions and plenty of screenshots to teach beginning and intermediate users this popular open-source scripting language.

Leading technology author Larry Ullman guides readers through the latest developments including use and awareness of HTML5 with PHP. Other addressed changes include removal of outdated functions and more efficient ways to tackle common needs
Amazon.com
10
)

Laravel: Up & Running: A Framework for Building Modern PHP Apps

by
Matt Stauffer
7.6
% recommend
🛒   Buy
What sets Laravel apart from other PHP web frameworks? Speed and simplicity, for starters. This rapid application development framework and its ecosystem of tools let you quickly build new sites and applications with clean, readable code.

Fully updated to cover Laravel 5.8, the second edition of this practical guide provides the definitive introduction to one of today’s mostpopular web frameworks. Matt Stauffer, a leading teacher and developer in the Laravel community, delivers a high-level overview and concrete examples to help experienced PHP web developers get started with this framework right away.

This updated edition also covers Laravel Dusk and Horizon and provides information about community resources and other noncore Laravel packages. Dive into features, including: Blade, Laravel’s powerful custom templating tool Tools for gathering, validating, normalizing, and filtering user-provideddata The Eloquent ORM for working with application databases The role of the Illuminate request object in the application lifecycle PHPUnit, Mockery, and Dusk for testing your PHP code Tools for writing JSON and RESTful APIs Interfaces for filesystem access, sessions, cookies, caches, and search Tools for implementing queues, jobs, events, and WebSocket event publishing
Amazon.com
9
)

PHP, MySQL, & JavaScript All-in-One For Dummies (For Dummies (Computer/Tech))

by
Richard Blum
7.8
% recommend
🛒   Buy
Explore the engine that drives the internet It takes a powerful suite of technologies to drive the most-visited websites in the world. PHP, mySQL, JavaScript, and other web-building languages serve as the foundation for application development and programming projects at all levels of the web.

Dig into this all-in-one book to get a grasp on these in-demand skills, and figure out how to apply them to become a professional web builder. You’ll get valuable information from seven handy books covering the pieces of web programming, HTML5 & CSS3, JavaScript, PHP, MySQL, creating object-oriented programs, and using PHP frameworks.

Helps you grasp the technologies that power web applications Covers PHP version 7.2 Includes coverage of the latest updates in web development Perfect for developers to use to solve problems This book is ideal for the inexperienced programmer interested in adding these skills to their toolbox. New coders who've made it through an online course or boot camp will also find great value in how this book builds on what you already know.
Amazon.com
8
)

Murach's PHP and MySQL (3rd Edition)

by
Joel Murach & Ray Harris & Anne Boehm
8.4
% recommend
🛒   Buy
"I can't count how many PHP books I have purchased over the years trying to learn the language. Murach's was the first book that helped me grasp the concepts and got me onto actually scripting in PHP." That's what one developer posted on the first edition of Murach's PHP and MySQL.

Now, this 3rd Edition does a better-than-ever job of delivering the skills you need to develop database-driven websites using PHP and MySQL, the way today's top web professionals do. Section 1 is a quick-start course that shows how to use the latest versions of PHP, MySQL (or MariaDB), and the Apache web server to build your first PHP applications.

Right from the start, you'll learn to create applications that conform to the MVC pattern, so they'll be easier to maintain as they grow. In addition, you'll learn how to create applications that prevent SQL injection attacks and guard against XSS attacks.

Section 2 takes you deeper into PHP by covering the skills you'll use every day, like how to work with form data, dates, arrays, sessions, cookies, functions, objects, regular expressions, and exceptions. Likewise, Section 3 dives into MySQL, teaching you how to design and create a database, as well as how to access and maintain database data from your PHP programs.

Finally, Section 4 teaches you important web programming skills like how to secure web pages, send email, upload files, and process images. Along the way, you'll find out how to take advantage of PHP 7 enhancements like scalar data type declarations and improved error handling, as well as new operators and functions.

Complete sample applications and chapter exercises provide training support throughout. A great choice for any developer who wants to master PHP without a lot of frustration and unnecessary expense.
Amazon.com
7
)

PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide

by
Larry Ullman
8.9
% recommend
🛒   Buy
When it comes to creating dynamic, database-driven Web sites, the PHP language and MySQL database offer a winning combination -- and with PHP 7, web professionals can achieve dramatic performance improvements. Combine these great open source technologies with Larry Ullman's PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide, Fifth Edition, and there's no limit to the powerful, interactive Web sites you can create.

With step-by-step instructions, complete scripts, and expert tips to guide you, Ullman gets right down to business. After grounding you with practical introductions to both PHP 7 and MySQL, he covers core issues ranging from security to session management to jQuery and object-oriented programming techniques
Amazon.com
6
)

Modern PHP: New Features and Good Practices

by
Josh Lockhart
9.1
% recommend
🛒   Buy
PHP is experiencing a renaissance, though it may be difficult to tell with all of the outdated PHP tutorials online. With this practical guide, you’ll learn how PHP has become a full-featured, mature language with object-orientation, namespaces, and a growing collection of reusable component libraries.

Author Josh Lockhart—creator of PHP The Right Way, a popular initiative to encourage PHP best practices—reveals these new language features in action. You’ll learn best practices for application architecture and planning, databases, security, testing, debugging, and deployment.

If you have a basic understanding of PHP and want to bolster your skills, this is your book. Learn modern PHP features, such as namespaces, traits, generators, and closures Discover how to find, use, and create PHP components Follow best practices for application security, working with databases, errors and exceptions, and more Learn tools and techniques for deploying, tuning, testing, and profiling your PHP applications Explore Facebook’s HVVM and Hack language implementations—and how they affect modern PHP Build a local development environment that closely matches your production server
Amazon.com
5
)

PHP and MySQL Web Development (Developer's Library)

by
Luke Welling & Laura Thomson
9.7
% recommend
🛒   Buy
PHP and MySQL Web Development, Fifth Edition The definitive guide to building database-driven Web applications with PHP and MySQL PHP and MySQL are popular open-source technologies that are ideal for quickly developing database-driven Web applications. PHP is a powerful scripting language designed to enable developers to create highly featured Web applications quickly, and MySQL is a fast, reliable database that integrates well with PHP and is suited for dynamic Internet-based applications.

PHP and MySQL Web Development shows how to use these tools together to produce effective, interactive Web applications. It clearly describes the basics of the PHP language, explains how to set up and work with a MySQL database, and then shows how to use PHP to interact with the database and the server.

This practical, hands-on book consistently focuses on real-world applications, even in the introductory chapters. The authors cover important aspects of security and authentication as they relate to building a real-world website and show you how to implement these aspects in PHP and MySQL.

They also introduce you to the integration of front-end and back-end technologies by using JavaScript in your application development. The final part of this book describes how to approach real-world projects and takes the reader through the design, planning, and building of several projects, including: User authentication and personalization Web-based email Social media integration Shopping cart The fifth edition of PHP and MySQL Web Development has been thoroughly updated, revised, and expanded to cover developments in PHP through versions 5.6 and 7, as well as features introduced in recent stable releases of MySQL.

Free Access to Web Edition Purchase of this book in any format, electronic or print, includes free access to the corresponding Web Edition, which provides several special features: The complete text of the book online Exercises and interactive quizzes to test your understanding of the material Bonus chapters not included in the print or e-book editions Updates and corrections as they become available The Web Edition can be viewed on all types of computers and mobile devices with any modern web browser that supports HTML5. Contents at a Glance Part I: Using PHP 1  PHP Crash Course 2  Storing and Retrieving Data 3  Using Arrays 4  String Manipulation and Regular Expressions 5  Reusing Code and Writing Functions 6  Object-Oriented PHP 7  Error and Exception Handling Part II: Using MySQL 8  Designing Your Web Database 9  Creating Your Web Database 10 Working with Your MySQL Database 11 Accessing Your MySQL Database from the Web with PHP 12 Advanced MySQL Administration 13 Advanced MySQL Programming
Amazon.com
4
)

The Joy of PHP: A Beginner's Guide to Programming Interactive Web Applications with PHP and mySQL

by
Alan Forbes
10.3
% recommend
🛒   Buy
Third Edition now with bonus chapters.Have you ever wanted to design your own website or browser application but thought it would be too difficult or just didn't know where to start? Have you found the amount of information on the Internet either too daunting or not geared for your skill set or worse-- just plain boring? Are you interested in learning to program PHP and have some fun along the way? If so, then The Joy of PHP by Alan Forbes is the book for you!! Alan starts with some basic HTML so the absolute beginner can catch up quickly and then goes step by step on how PHP works. You start with the easy stuff--like how to create and run simple PHP scripts that modify web pages-- and then build on what you've learned through a series of cohesive (and fun) exercises that carry over from lesson to lesson.

As the chapters progress you begin to build a web site for a growing used car dealership business. This approach keeps the material fun and challenging-- and gives what you've learned a context to be relevant.

A car dealership needs a constantly changing web site because the inventory of cars is always changing. HTML is not the answer for this kind of web site-- but PHP and mySQL are! Throughout the book you will be working with the web site for the car dealership and adding features and modifying it as the needs of the business (and your knowledge) grow.

This writing style reinforces the previous lessons and keeps you engaged in a "real" project -- giving you both a sense of accomplishment and an opportunity to apply what you've learned to a realistic scenario. You are far more likely to retain what you've learned using this approach than just reading dry syntax documentation.

The author has an easy and fun style of writing that teaches you PHP in a simple, matter of fact manner while showing you the most common uses of the commands you need to get the job done. This keeps your learning pace quick and uncluttered.

If you need it, he also points you to several resources where you can learn more about the other options a PHP function can offer and-- even better--how to read and understand those resources. If you want to learn the PHP language in an easy, enjoyable, well laid out manner and to learn why PHP and mySQL are so powerful and fun to use then buy this book!! Do not buy this book if you are looking for a comprehensive reference of boring PHP syntax.

This book does not attempt to cover everything about PHP. What it does do-- and does well-- is take you from being a beginner who isn't even sure what PHP is to someone who knows the sheer joy that only programming dynamic sites can provide.

You will become someone who can read, write, and modify PHP scripts and you will be able make your website come alive. Bonus Code All the source code referenced in the book is available for easy download and well organized.

You don't have to cut and paste out of Kindle or retype code, unless you want to. There is even a video tutorial showing how to get started.

Topics Covered... - Installing and configuring PHP - Introduction to HTML - Basic PHP Syntax - Some Fun Right Away - Editors and Staying Organized - Variables, Numbers, Dates and Strings - Control Structures - How to use a database, such as mySQL - Using PHP and mySQL Together - How to create forms to Display, Add, Edit, and Delete data - Session Variables - Working with Images - PHP File Uploads - PHP Quirks and Tips - Security Considerations This book is NOT the only book you'll ever need to read to master PHP.

The book is a gentle introduction to a very rich topic. The hope of the author is to show you that PHP isn't really that scary after all, it is something YOU can do, and it can even bring you joy once you get it.
Amazon.com
3
)

Web Coding & Development All-in-One For Dummies (For Dummies (Computer/Tech))

by
Paul McFedries
11.4
% recommend
🛒   Buy
Speak the languages that power the web With more high-paying web development jobs opening every day, people with coding and web/app building skills are having no problems finding employment. If you’re a would-be developer looking to gain the know-how to build the interfaces, databases, and other features that run modern websites, web apps, and mobile apps, look no further.

Web Coding & Development All-in-One For Dummies is your go-to interpreter for speaking the languages that handle those tasks. Get started with a refresher on the rules of coding before diving into the languages that build interfaces, add interactivity to the web, or store and deliver data to sites.

When you're ready, jump into guidance on how to put it all together to build a site or create an app. Get the lowdown on coding basics Review HTML and CSS Make sense of JavaScript, jQuery, PHP, and MySQL Create code for web and mobile apps There’s a whole world of opportunity out there for developers―and this fast-track boot camp is here to help you acquire the skills you need to take your career to new heights!
Amazon.com
2
)

Head First PHP & MySQL: A Brain-Friendly Guide

by
Lynn Beighley & Michael Morrison
11.7
% recommend
🛒   Buy
If you're ready to create web pages more complex than those you can build with HTML and CSS, Head First PHP & MySQL is the ultimate learning guide to building dynamic, database-driven websites using PHP and MySQL. Packed with real-world examples, this book teaches you all the essentials of server-side programming, from the fundamentals of PHP and MySQL coding to advanced topics such as form validation, session IDs, cookies, database queries and joins, file I/O operations, content management, and more.

Head First PHP & MySQL offers the same visually rich format that's turned every title in the Head First series into a bestseller, with plenty of exercises, quizzes, puzzles, and other interactive features to help you retain what you've learned. Use PHP to transform static HTML pages into dynamic web sites Create and populate your own MySQL database tables, and work with data stored in files Perform sophisticated MySQL queries with joins, and refine your results with LIMIT and ORDER BY Use cookies and sessions to track visitors' login information and personalize the site for users Protect your data from SQL injection attacks Use regular expressions to validate information on forms Dynamically display text based on session info and create images on the fly Pull syndicated data from other sites using PHP and XML Throughout the book, you'll build sophisticated examples -- including a mailing list, a job board, and an online dating site -- to help you learn how to harness the power of PHP and MySQL in a variety of contexts
Amazon.com
1
)

Learning PHP, MySQL & JavaScript: With jQuery, CSS & HTML5 (Learning PHP, MYSQL, Javascript, CSS & HTML5)

by
Robin Nixon
17.8
% recommend
🛒   Buy
Build interactive, data driven websites with the potent combination of open source technologies and web standards, even if you have only basic HTML knowledge. In this update to this popular hands on guide, you’ll tackle dynamic web programming with the latest versions of today’s core technologies: PHP, MySQL, JavaScript, CSS, HTML5, and key jQuery libraries.

Web designers will learn how to use these technologies together and pick up valuable web programming practices along the way—including how to optimize websites for mobile devices. At the end of the book, you’ll put everything together to build a fully functional social networking site suitable for both desktop and mobile browsers
Amazon.com

Conclusion

I hope that you liked this list. Please do not hesitate to check out the other ones I've published.

Keep me updated!

Receive weekly update about best programming books!
Just that, no spam, no bs.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.