PHP-backend Roadmap
Tags: php, webdev, beginners, programming
Published: 2021-09-11 19:35:24

There are tons of tools in IT to ease programmers' workflow and make a product more efficient. But in the very beginning of honing PHP that might be such a puzzle to pick the right direction and instruments to learn first. A common solution for such problems now – roadmaps – visual sequences which answer the question "what to learn next?". Subject I'd like to discuss in the article – where to invest your time and efforts to learn PHP faster and become an in-demand backend programmer.

### PHP & Git basics

To learn the programming language – just a beginning. And even here it's important to make the right steps. Don't aim to learn and memorize everything about PHP and simply focus on tools you'll be using 90% of the time. And of course, always apply gathered skills in practice.

![img1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m3l8dhyku0au5vhx06pq.jpg)

The next deserving attention thing after learning PHP – [Git](https://git-scm.com/). You'll probably be using it on a daily basis regardless of your chosen programming language. In a nutshell, Git is a team cooperation tool, which allows you to save states of a code.

### Composer and databases

Usage of external libraries is a great solution in most cases. Especially if they earned the community's trust. To use it efficiently you should learn the [Composer](https://getcomposer.org/) – a packet manager to extremely ease the process of connecting and updating all your PHP dependencies.

![PHP Backend Roadmap (7)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vnphf7d3qhdpd1evlzq2.jpg) 

And finally, we got to the databases. There are so many solutions in the market so it's even hard to list and not to forget any. However, there are few leaders of the field, which I personally recommend to pick for your stack. For relational databases it's [PostgreSQL](https://www.postgresql.org/download/), and for NoSQL – [MongoDB](https://www.mongodb.com/try/download/community). [PDO](https://www.php.net/manual/ru/book.pdo.php) will be useful for understanding how all the interaction between PHP and your data happens, and ORMs – will boost the effectiveness and security of that communication.

### Working flow optimization

For any programmer, speed is one of the most important factors. And debugging speed affects it directly. There are two main solutions to get rid of seeded `echo` and `var_dump` from a code, but my advice is to use the first and more common – xDebug. It's not ever hard to connect and configure it but it will always be bringing benefits.

![PHP Backend Roadmap (8)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zzlphb9ewd4nrbvj3tr1.jpg) 

But the quality of the code and its style may seem subjective things, but teamwork requires it really often. In the [PSR-12](https://www.php-fig.org/psr/psr-12/) standard, you can find the list of recommendations on how to style it. That standard isn't the only existing one, but it's definitely the most common. To simplify following it you can use [CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer). And in order to develop the habit of writing clean code, you can use [Psalm](https://psalm.dev/), [Phan](https://psalm.dev/), or [PHPStan](https://phpstan.org/) linters. There's no need to learn each – better to choose the one you like most. In my case it's Psalm.

### What about HTML?

Talking about PHP there is less and less mentioning of Full-stack. Fields of work have long been divided and PHP has taken an honorable place at the backend. Therefore learning HTML isn't a requirement for us but rather an optimization. What is really important is to clearly understand how to implement interaction with the front-end. Essential things in this area for us are REST and JSON API. Web-browser might be replaced with [Postman](https://www.postman.com/downloads/) – an ultimate tool to debug API. Earning a habit of documenting interfaces using [OpenAPI](https://swagger.io/specification/) or [Blueprint](https://apiblueprint.org/) will save you from constant questions from colleagues and give you +10 to karma.

![PHP Backend Roadmap (9)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qpp9vsbwdluv1yimkepr.jpg) 

### Boosting up the project

The high response rate of the project is due not only to the servers but also to high-quality code. Sometimes to increase it, it's enough to reduce the number of requests to the database or to remember the result of heavy calculations. Caching mechanisms can help us in this. You will find interfaces for organizing them in the [PSR-6](https://www.php-fig.org/psr/psr-6/) and [PSR-16](https://www.php-fig.org/psr/psr-6/) standards. And choose the final caching mechanism depending on the project.

![PHP Backend Roadmap (10)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w1ewsxnflinlqhzlv38y.jpg) 

Another common method of speeding up a project is to perform processing in the background. There are two categories of solutions here: task schedulers ([Crontab](https://timeweb.com/ru/community/articles/chto-takoe-cron)) will be useful for performing mailings, recalculating tariffs, and other regular tasks. And message brokers will allow you to take heavy operations into the background and monitor their execution without slowing down the response to the user.

### Testing and frameworks

Not all teams write tests for the code. This decision can be made on the basis of many factors. But understanding how to write the testable code is extremely important. Practicing with [PHPUnit](https://phpunit.readthedocs.io/en/9.5/) will help you gain knowledge in this area. And if you want to try other approaches, pay attention to [Codeception](https://codeception.com/quickstart).

![PHP Backend Roadmap (11)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pf4rmz95zklahpao0ir5.jpg)

When a lot of tools have been studied, it's time to combine them into a coherent system. In order not to reinvent the wheel, pay attention to one of the popular frameworks. In them, you will find the best modern practices, as well as get used to high-quality architecture. I suggest making a choice from the two most popular options:

- [Symfony](https://symfony.com/download) – strict and exacting, used mostly in highly loaded applications.
- [Laravel](https://laravel.com/) – the most common and popular today.

### Profiling and monitoring

When your project is launched, it is important to monitor its "health". Are the servers coping? Is there a DDoS attack? Is there a fatal exception on the prod? Monitoring is a simple and useful tool that will give you answers to all these questions. You should start with logging. The [PSR-3](https://www.php-fig.org/psr/psr-3/) standard describes the interface, and [Monolog](https://github.com/Seldaek/monolog) will save you from having to write your own logging service. [Sentry](https://sentry.io/) will help you to be up to date with errors, [Grafana](https://grafana.com/) will build beautiful graphs, and [Graylog](https://www.graylog.org/products/open-source#download-open) or [ELK](https://www.elastic.co/what-is/elk-stack) will simplify log search and incident investigation.

![PHP Backend Roadmap (12)](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20ejicym8fim0yjdgw7w.jpg) 

However, there are cases that cannot be solved by simple monitoring. For example, if the application is abnormally slow in certain areas. Such incidents are most effectively solved with the help of profiling tools. You will not use them so often, but it is important to remember about their existence.

Of course, the PHP world is not limited to the listed tools and, after mastering them, there is still a lot to learn. But remember: at the beginning of your journey, you should focus on the main and most common things that you will meet in 80-90% of teams. All the listed programs and approaches were chosen according to this criterion. Save the [roadmap](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2ma4v7424vdtxfb9b8wr.jpg), and check it in your educational adventure. And finally: success in studying and building a career.