Web Development — Level 3: Back-End with PHP, MySQL & Laravel
Get Started Free
Free preview
How the server side works
Lecture notes
In Levels 1 and 2 everything ran in the browser. Real applications also need a server: a program that receives requests, checks who the user is, reads and writes a database, and sends back HTML or JSON. This is the back end.
The request–response cycle
- The browser sends an HTTP request:
GET /coursesorPOST /login. - The web server (Nginx, Apache or PHP's built-in server) passes it to PHP.
- PHP runs your code, queries MySQL, builds the response.
- The browser receives HTML (a page) or JSON (for JavaScript).
The user never sees your PHP code — only its output. That is why secrets (database passwords, API keys) live on the server.
Why PHP?
PHP runs a large part of the web (WordPress, Wikipedia, Laravel applications), is available on almost every host, and PHP 8 is fast with types, enums and attributes.
Setting up
- Windows: Laragon or XAMPP installs PHP, MySQL and a web server together.
- Install Composer, PHP's package manager.
- Check:
php -v,composer -V. - Quick test server:
php -S localhost:8000in a folder containingindex.php.
<?php
echo "Hello from the server, it is " . date('H:i');Want to go further?
20 h · Enroll to access every lesson and earn the certificate.