This is the second piece of my series on how to start a Software Development career. I recommend giving that a quick read if you haven’t already.
I’ve been writing PHP since 2011. Despite having years of experience under my belt, I still don’t feel like an expert. A big part of that is because the language continues evolving, so there’s always something new to learn. Even from my point of view, figuring out what’s new and how it could be applied practically can be a daunting task.
Suppose though if I were to bring my 2011 self to today, where I was just beginning my PHP journey. What advice would I give to that naïve, bright-eyed kid so that he could pick up the language in as short amount of time as possible?
I’d start of by telling him that what I can provide is a roadmap with the goal of becoming technically proficient in PHP, while attempting to help avoid some pitfalls and delays. What I can’t provide is a PHP manual. I’d only be highlighting essential points of interest that must be grasped to become a PHP developer. Anyone with this information should have a good enough understanding to know where and how to proceed next (don’t worry, I’ll give some suggestions for that as well).
Environment
Schools provide an environment for people to learn a subject matter, the same applies to PHP. Before we even begin writing our first lines of PHP code we need to make sure we’ve set up the proper environment first. Nowadays, a tool called Docker makes that super easy.
Docker is an application that creates different virtual environments. Most software development languages create images (essentially blueprints) that sets everything you’d need to start coding away behind the scenes for you. Here’s PHP Docker Image. After you check that out, we’ll need to open up a terminal window and set it up like so:

In the same terminal window you can then open an interactive instance of PHP:

This is useful if you’d like to write a few lines of PHP code and see how the language behaves. We need to take things a step further though if you have hopes of one day mastering this language!
Docker Compose
Before we get started with Docker Compose, we need to add the following line:
0.0.0.0 docker.local
to our hosts file. Instructions for how to do this on all major systems are located here.
Now, create a new project folder, I’m going to call mine my-first-php (mine is inside my blog working directory, it’s ok for yours to start at my-first-php). Inside it we’ll need the following directories:

Now you’ll need to create these 3 files (full path shown so that you know where to place them):
1. my-first-php/docker-compose.yml
2. my-first-php/.docker/php/Dockerfile
3. my-first-php/.docker/nginx/site.conf
Once those files are in place, open up your terminal and run this command:
docker-compose up –build
A bunch of text should fly by. When everything ultimately settles you should see something similar to this:

Now open up a separate terminal window and type the following command:
docker exec -it php bash
You should see a screen like this:

What we’ve done above is akin to SSH’ing into a remote server running PHP. Try typing in php -a and you’ll see that it brings up PHP’s interactive shell again!

If you were to go to http://docker.local you should see:

This means that NGINX is responding to our local HTTP request. However, we configured it to look for an index.html or index.php file as the main entry-point for our application. So let’s set that up real quick:

Reload your browser and…

Getting this all set up is probably half of the battle, and I hope you’ve found these steps extremely simple to follow. From here I’d suggest installing a framework, because they’re full of code that I’ll describe in a section below that you must grasp if you hope to level-up your new found development skills!
Data Structures
This is the next most important area to master. When it comes to PHP, the Array is king. You have to learn what the difference is between a regular and an associative array. Then you should learn about multi-dimensional arrays. Finally, you should understand what a Stack and Queue are and how to construct and use them. Bookmark this page while you’re learning about all of this, you’ll thank me.
Object Oriented Programming (OOP)
The very first folks that started writing PHP code had no choice but to code in a style known as procedural programming. For a characterization of what that means, picture an entire application running line-by-line in a single file. This might not seem like the worst thing in the world, but do it for any length of time and soon you’ll discover all the problems involved with this approach. Some of the biggest were that there was no code-reusability (unless you consider that to be copy-and-paste), variables were in a global scope and could be altered at any point of your script’s execution (making it very difficult to trace down exactly where that would occur), and you had to ensure that any files you needed were properly loaded at the very start of your script (otherwise your script would just stop executing).
Implementing OOP in your PHP project resolves these issues and more! So it is important that you learn about what it is and how to use it. The sooner you master this concept, the sooner you’ll be writing flawless, reusable, resilient code!
Relational Database Management System (RDBMS)
You should learn about what an RDBMS is, and how to use SQL. PHP integrates with a few different RDBMS’s of which MySQL, PostgresSQL, and MariaDB are probably the most well-known and supported. They each have their own set of strengths and weaknesses, as well as their own flourishes (or quirks) for their SQL. You should look into what those differences are before deciding which one you like best. The docker-compose.yml file above utilizes MySQL because that’s what I’m most familiar with but can be easily replaced with whichever system you like best.
No matter which system you end up using, some of the key concepts to understand are SELECT, JOIN (INNER, LEFT, OUTTER, FULL), and GROUP BY statements. Before that you’ll need to familiarize yourself with and use INSERT INTO, UPDATE and DELETE statements. Finally, you’ll need to understand what PDO is and how PHP uses it to talk to the database system.
Conclusion
You don’t need to learn about these topics in any particular order. But you must get the hang of each one if you have any hopes of becoming a PHP developer, let alone a software developer. Once you get the basics, you’ll find it’s almost as easy as learning to ride a bike!
As promised, where I think you should go from here:
- Learn about HTML and JavaScript, and how the latter can alter the former
- Version/Source Control with Git
- Understanding what HTTP requests are and what a RESTful API is
- Everything should culminate with understanding what MVC and SPA mean, and how to build them
I plan to continue writing about ways to learn about all these different technologies and what you should focus on when you do, so if this interests you make sure to give me a follow on Twitter!
If you have any questions, comments, or concerns please reach out!


Leave a Reply