If you’re getting started learning PHP or want to get started, this post is for you. In it, I step you through the essential things you need and things you need to know to start your learning the right way.
When starting anything new, whether that’s a human or software development language, it’s often challenging to know where to start, what tools and other things you’ll need, how to measure your progress, and what exactly you need to learn.
PHP is no exception.
So, after putting quite some thought into this, here’s what I believe you need to do to learn PHP in 2025.
The absolute essentials
While there are so many things that you could start with, let’s keep this as simple and focused as possible, concentrating on the absolute essentials of:
- The PHP runtime.
Available on all major operating systems, naturally, you’re going to need this.
I recommend using at least version 8.3 if not 8.4.
- A text editor or IDE.
Naturally, you’re going to need something to write PHP code.
So either grab a copy of an IDE that’s tailored to PHP, such as PhpStorm, or a (rich) text editor such as Visual Studio Code.
Sure, the text that comes with your operating system will do, but a more full-featured one, one that’s able to be expanded and customised will give you a more enjoyable and rewarding experience.
- A terminal.
Finally, you’ll need something to run the code.
I get that not everyone is a fan of the terminal.
So, if that’s you, your IDE or text editor should be able to handle this for you.
- Composer.
No modern PHP development environment is complete without Composer, PHP’s gold-class package manager.
You’re going to need this to bring in external packages, keep your code properly organised, simplify build and testing tasks, and so much more.
With these in place, you’re ready to start learning PHP.
However, I see them as just the initial things you’ll need.
You’ll likely want to go further with the following:
Docker or Podman
If you’re familiar with containerisation (which we all likely are) you might prefer to use either Docker (and Docker Compose) or Podman to simplify creating development environments for your PHP projects, instead of installing everything directly on your local development machine.
Doing so could greatly simplify switching between versions of PHP and installing various PHP extensions.
If you are more familiar with (or prefer) Docker, make sure you check out Deploy With Docker Compose, a free book that I wrote, taking you from zero to deployed PHP app with Docker Compose.
And, if you develop with Laravel, check out Laravel Sail, a light-weight command-line interface for interacting with Laravel’s default Docker development environment.
A data source
In the early days, PHP was synonymous with MySQL; according to the JetBrains 2024 State of Developer Ecosystem Report it’s the most popular choice.
Despite being around in those days, I don’t remember why the two were synonymous with one another.
Actually, even at the time I don’t think I knew why, though this Quora thread may have the answer.
That said, there are so many options to choose from these days, including my favourite is SQLite, as well as PostgreSQL, Microsoft SQL Server, Redis, Amazon Athena, and Couchbase.
Additional items
If you really want to learn PHP properly, however, you’re going to need a number of additional things.
Let’s look at what those are.
Know how to organise your code
You need to know how to organise the source and related files that your project will require, such as your tests.
Now, proper file organisation isn’t specific to PHP, as any good software language or project requires a high degree of proper organisation.
Gladly, PHP has PSR-4 (Autoloader) to help you manage this, which describes where to place files.
I strongly encourage you to familiarise yourself with the PSR and Composer’s autoload documentation.
There are many CI/CD (Continuous Integration/Continuous Deployment) tools available that support PHP, such as GitHub Actions, Jenkins, GitLab, CircleCI, [TeamCity(https://www.jetbrains.com/teamcity/)], and Travis CI.
If you’re not familiar with the term, CI/CD tools automate building your (PHP) applications, such as running tests and all your other QA tools, and deploying them to production.
Whereas you, and the rest of your team, might have run tests and static analysis, as well as deployed apps manually, doing so can be quite involved.
What’s more, it leaves open the possibility of one or more steps being missed, leading to failed deployments (and unhappy users) as well as requires unnecessary effort, reducing the time that the development team can be maintaining the code.
So, familiarise yourself with a CI/CD tool, making sure your know the basics of how to configure it, as well as what its key commands are.
Let’s take my preferred tool, GitHub Actions, as an example.
To configure it, you use Yaml files and store them in a directory named .github/workflows in your project.
By doing so, no one needs to learn a new UI for configuring project integration, and the configuration is kept alongside the code that it builds.
Here’s a simple example of a Yaml configuration file:
name: PHP QA Suite
on:
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate composer.json and composer.lock
run: composer validate --strict
- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v3
with:
path: vendor
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-php-
- name: Install dependencies
run: composer install --prefer-dist --no-progress
- name: Run QA suite
run: composer run-script cs-check
- name: Run test suite
run: composer run-script test
Stepping through it from top to bottom, the workflow is named “PHP QA Suite”, as it runs the QA tools on the project’s code, but doesn’t deploy the code.
Then, it provides instructions for when to run the workflow.
In this case, they’ll be run when pull requests are made against the main branch.
Then comes the jobs that will be run in the workflow.
In the above example there is only one, named “build”, which has six steps:
- The first checks out the source code
- The second runs composer validate.
This checks if the project’s composer.json file is valid.
In addition, if a composer.lock file exists, it will checks if it’s up to date with composer.json.
- The third job sets up a cache for the Composer packages, so that the same packages don’t need to be downloaded repeatedly on multiple runs of the “build” job.
- The fourth job uses composer install to install PHP’s external dependencies
- The fifth runs a Composer script named “cs-check”, defined in the project’s composer.json file, that runs coding standards checks with PHP_CodeSniffer.
- The sixth and final step runs the code’s test suite.
Know what Composer is and how to use it
This should be a given, but perhaps I’m biased, but I believe that you need to know what Composer is, why you should use it, and how to use it.
If you’ve not used Composer before, then start with the Basic Usage section of the documentation.
This section shows the essentials of composer.json and how to install and update project dependencies, as well as autoloading.
Then, if you’d like to dive into particular areas, I’ve written a series of hands-on tutorials for your reading pleasure.
Familiarise yourself with PHP’s recent changes
PHP’s up to version 8.4, so it has a lot of functionality and features.
While you could take the time to learn about all of it, and I strongly recommend you diving deep into it, start with the 8.x release.
To me, it’s one of the most exciting releases because of features such as:
Your best source of information is the PHP documentation; you’ll always find a link to the latest changes on the home page.
However, two other great sources are PHP.Watch and stitcher.io.
And, if you want to know what’s coming in future releases, check out the PHP RFCs (Requests for Comment).
Know the basics of automated testing
I know that I don’t speak for everyone when I say that automated testing is an integral part of software development – not something that you add on or bolt on later.
I’ve worked in development shops where testing was the developer checking their work in their browser or with curl requests after they’d written it, and if it worked, it was committed and pushed to production.
I’m sure that that works for some people.
But I’m not one of them.
For me, tests need to be automated so that they’re repeatable, provide additional knowledge about the application – and so much more.
But, I’ll leave that debate for another date and another post.
For now, you need to know the following:
- What testing is
- What a testing framework is
- The benefits of using testing and a testing framework when building quality software; and
- The basics of using a testing framework with your PHP code
There are many different types of testing used in modern PHP development, including unit, functional, integration, and smoke testing.
Then, at a higher level, there are different testing methodologies, such as Test-Driven Development (TDD), and Behavior-Driven Development (BDD).
If you’re coming to testing for the first time, or are quite new to it, you could easily feel quite confused as to where to start.
So, my advice is to start with unit tests, then progress from there.
To do that, start with PHPUnit, one of the oldest – if not the oldest – testing framework for PHP.
Once you’re familiar with PHPUnit, then, if you need to, branch out from there, to other frameworks and tools.
You’re not short of options.
such as there’s Pest, Behat, Codeception, and Selenium to name but a few.
Know the fundamentals of Object-Oriented Programming (OOP)
While PHP can be written in both a functional and an OOP-style, the latter is far more prevalent in my experience.
There’s a bit to learn if you’re new to the topic, so here are some resources to get you started:
Additional PHP learning resources
I would feel deeply remiss if I didn’t provide additional resources for learning PHP, so that, as the saying goes, you can help those who help themselves.
So, here are a host of resources that I’m using in my PHP journey.
I hope that they help you as well.
Forums
I’m a strong believer that we learn better with and from others.
So, here’s a set of great groups and forums filled with knowledgeable, experienced PHP developers who are ready to help one another:
Podcasts
If you prefer to learn by listening, or learn on the go such as when driving, riding, walking, or commuting, here is a short selection of podcasts to add to your collection:
Developers to Follow
If you’re looking for some great PHP-focused/experienced developers to follow, here is a small selection of the ones that I am familiar with.
- Andreas Heigl
Contributor to PHP-Systems and PHP-Core and international conference-speaker
- Beau Simensen
Staff-plus Software Engineer
- Chris Hartjes
Helping to build web sites of all shapes and sizes since 1998, mostly with PHP and teacher of automated testing
- Chris Tankersley
Founding core committee member of the PHP Framework Interoperability Group (PHP-FIG), international speaker, PHP developer, and podcast host
- Damien Seguy
CTO at Exakat Ltd., a company specialized in PHP code quality solutions for the industry, and international conference speaker.
- Derick Rethans
The creator and primary maintainer of Xdebug, PHP’s debugger
- Dries Buytaert
The founder of Drupal and Acquia
- Dries Vints
Software engineer at Laravel, creator of Eventy, and open-source maintainer
- Eryn O’Neil
A Minneapolis-based freelance PHP developer and tech lead
- Florian Engelhardt
PHP developer, software architect, and technical consultant
- Frank de Jonge
Software engineer, and long-time open source contributor with packages downloaded over a billion times.
- James Titcumb
Freelance consultant developer with Roave
- Jessica Mauerhan
Software engineer since 2004 primarily focused on PHP, mentor in automated testing, test driven development, behavior driven development, and quality code
- Joe Ferguson
A software developer specializing in infrastructure, DevOps, and back-end development
- Jordi Boggiano
Co-creator and maintainer of Composer and Packagist.org (the accompanying package registry)
- Juliette Reinders Folmer
Software consultant and web-developer, open source contributor, long-standing member of [PHPWomen], and international conference speaker
- Larry Garfield
Staff Engineer at LegalZoom, long-time PHP and Drupal contributor, and member of the PHP-FIG Core Committee
- Margaret Staples
CFSF - interim CTO
- Mark Baker
Coordinator and lead developer for the PHPExcel library, and a coordinator and developer on the PHPOffice library suite – PHPWord, PHPPresentation (formerly PHPPowerPoint), PHPProject and PHPVisio
- Matt Stauffer
Co-founder of Tighten and international conference speaker
- Matthew Weier O’Phinney
Software engineer and architect, PHP expert, standards developer, and product manager, and laminas project lead
- Matthias Noback
Trainer, writer, and developer of web applications since 2002
- Matthiew Napoli
Open-source developer and consultant, and the creator of Bref, the serverless framework for PHP
- Michaelangelo van Dam
Veteran web application developer & architect with nearly thirty years of experience solving complex business challenges with high availability requirements
- Nikita Popov (nikic)
A senior software engineer at Red Hat, working on LLVM, Clang and Rust
- Nikola Posa
A software architect specializing in PHP-based applications and web services
- Marco Pivetta (Ocramius)
Software consultant working for Roave
- Pauline Vos
Software engineer and speaker from Amsterdam
- Rafael Dohms
Engineer. Speaker. Teacher.
- Rob Allen
Software Consultant and developer, and founder of nineteenfeet
- Samantha Quiñones
Community activist and software engineer from Brooklyn, New York.
- Sebastian Bergmann
Creator of PHPUnit
- Stefan Koopmanschap (Skoop)
PHP developer, speaker, anti-capitalist, and entrepreneur
- Stephan Hochdörfer
Software developer, conference speaker, bitExpert co-founder, and unKonf host
- Taylor Otwell
Creator of Laravel
Good PHP books to read
If you’re someone who prefers a good read and to learn by reading, then here is a small selection of books to get you going.
Screencasts, Videos, and Courses
Do you prefer to learn by watching great content?
Then here are some solid resources to get you started.
That’s how to get started learning PHP in 2025
I’ve gone on for a while now.
Let’s bring this post to a close.
If you’re starting out with PHP this year, I hope that the information and resources that I’ve presented help get you off to a great start.
If you’ve been learning for a little while now, what resources would you add?
Join the discussion
comments powered by Disqus