What Does a PHP Developer Do?

An introduction to what a backend web developer's day might be like.

·

7 min read

Perhaps you're interested in becoming a web developer, or are starting to learn PHP. This article talks about what you need to learn to get started as a working PHP developer (like HTML, CSS, and SQL) and what tasks the daily grind of a PHP developer involves.

PHP is a programming language that is used on the "back-end" of websites. This means that it runs on the server that people visit to access a web site, but it does not run in the browser. If you try to load a PHP file in Chrome or Safari, you'd probably just see the source code and it wouldn't look right.

As a PHP developer, you would be writing code that runs directly on the server, and typically this code will execute when a user visits the webpage and generate the HTML that is sent by the web server software (such as Apache or Nginx) to a user's web browser. See my introduction to PHP for some very simple examples of PHP code.

Programmers who write code intended directly for consumption by a browser are called "frontend developers", whereas programmers who specialize in writing code mainly intended to run on the server are called "backend developers". Many developers have to handle both, however. These developers who are responsible for the whole widget are called "fullstack developers", which are likely to be found in smaller organizations.

What do I need to know to become a PHP developer?

If you want a job (or hobby) as a PHP developer, there are certain prerequisites that you will need some degree of competence in. Although this may seem overwhelming at first, you only need to know a few basic things to get started and you can learn more as needed.

  • HTML - Hypertext Markup Language. This is the language that lays out the structure and content of a webpage. HTML is fairly easy to learn and once you learn a few dozen HTML tags, you can begin building simple websites. This is critical because most of what you would be doing as a PHP developer is writing the code that generates the HTML that browsers turn into a human-readable page.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>
  • HTML is used to create forms that accept user data that ends up in databases or gets emailed to site administrators. Learning how to create forms is very important and getting very good at this is quite an art.
  • CSS - Cascading Stylesheets. This is the language used to style web pages and make them look nice. CSS is easy to start learning but can get very complicated and takes years to master with all the quirks. Although mastery of CSS is more important for front-end developers, even backend devs must at least know the basics since they will likely be writing webpages with a language like PHP that have some CSS.
    /* This stylesheet will make a page's body black with white text */
    body {
    color: white;
    background-color: black;
    }
    
  • SQL - Server Query Language. This is the language used to get data into and out of databases. Any website of serious complexity that solves a business problem will need to store and access data, and the most common way of doing this is with a relational database like MySQL. Getting started with simple queries is fairly easy. Here is an example of a query that returns all the data from a table containing user information.

    SELECT * FROM users;
    

    SQL can get very complicated when you have to join data from multiple tables or optimize performance with huge databases having millions of records. There are also a number of security issues that you have to be aware of — for instance, if you are not careful, a malicious user could easily inject an SQL query of their own into a form and do something like wipe out data or discover information that they aren't supposed to see!

  • Linux Administration/CLI (Command Line Interface). Most webservers run Linux or some Unix variant, although it is certainly possible to run a Windows Server installation. In the PHP world, Linux is a very common platform. Depending on the role you have, you will probably need to understand the basics of using a command line interface to install and configure a server, restart a webserver (like Apache), or perform other system maintenance tasks. This is particularly true for backend developers, although some proficiency with command line applications is also very helpful for frontend developers as so much of the tooling needed for sophisticated websites also runs in a CLI.

  • PHP (PHP Hypertext Preprocessor). Obviously, to be a backend or fullstack web developer you also have to know the language that runs on the backend, which is often PHP. (Python, Java, and JavaScript via Node.js are also very common). PHP is considered a fairly easy language to get started with. It has a clear and simple syntax, and doesn't require complex build and setup to run in many cases. Additionally, there is an excellent ecosystem of PHP packages and frameworks (like Laravel) that take a lot of the hard work out of large and complex projects.

Here is an example of a very simple webpage that uses PHP.

<?php
  $message = "Hello World!";
?>
<html>
<body>
<?php
  // The ‘echo’ statement will output the value of the variable.
  echo $message;
?>
</body>
</html>
  • Git. Git is a version control system that allows you to keep track of changes in your code and easily share with other people. This is particularly important when you are working on a project with many other people. It is not necessary that you know Git in order to get started, any serious working developer will be competent with Git. Git can be confusing, but there are programs like the Git Desktop Client that make getting started and doing basic operations pretty easy. In the end, all Git does it keep track of what changed in each file and it makes it easy to roll back or switch between versions when something goes wrong.

What does the daily work of a PHP developer look like?

Obviously what the job environment is like will depend on a number of factors including what company you are employed with, but if you are employed as a developer, most likely you will be performing the following kinds of tasks.

  • Meeting with project stakeholders (the people who actually want software made, or perhaps the business owners) and discussing what changes and new features need to be made.
  • Editing HTML, PHP, and SQL code in an IDE (editor) like VS Code or PHP Storm to create new features and update web applications.
  • Running and testing websites on a number of browsers using browser developer tools to ensure they work correctly.
  • Writing automated tests in a framework like PHP Unit to ensure code works correctly.
  • Committing code (usually via Git) into a repository to keep it safe and allow others to use it.
  • Responding to user reports of bugs or issues with websites.
  • Updating software on webservers or adjusting configuration to adjust the way websites run.
  • Troubleshooting server issues.
  • Investigating security related issues, website hacks, database leaks. (Although hopefully you can be careful enough to avoid most of these kinds of issues!)

What makes being a PHP developer great?

Although the list above includes its share of frustrating and difficult tasks, being a web developer can be very rewarding and exciting too. If you love creating things, putting your creation out there and seeing the impact it can have on the world, there is a great deal of fulfilment to be had being a web developer. You get to mold the future with your mind and build things that never existed before.

You usually get to work in a nice office environment or at home, solving problems and making things work well. There are also lots of great people in the PHP developer community willing to help out and lend a hand if you get stuck, so the sense of community is a great aspect of being a developer.

If this sounds great to you and you'd like to learn more about PHP and web development, follow me on Twitter and feel free to reach out with any questions!