Demo mode This site is not live. It is currently being tested and developed. Nothing on here represents an offer.
← Exit course WEB-301 Full-Stack Web Development with PHP and Laravel
Course progress, 0 of 17 parts done0%

Review Study Aid

Download as PDF

The points to fix in memory before the self assessment.

Definitions you must be able to give

  • WSL 2 runs a real Linux kernel in a lightweight virtual machine inside Windows.
  • A package manager, apt on Ubuntu and Mint, installs packages from repositories with everything they need.
  • A cluster is one running PostgreSQL server with its own data folder and port, such as 18/main on port 5432.
  • A role is a PostgreSQL user, a login role may connect, and a superuser may do anything.
  • A connection string packs host, port, database, user and sometimes password into one piece of text.
  • libpq is PostgreSQL's client library, used by psql and by PHP's pdo_pgsql driver.
  • PHP's built-in server, started with php -S, is a development web server that must never face a public network.

Commands and syntax to know

  • wsl --install installs WSL and Ubuntu, and wsl -l -v lists distributions with their WSL version.
  • php -v, php -m and php --ini show the version, the extensions and the settings files.
  • composer -V shows Composer's version and the PHP it runs on.
  • sudo -u postgres createuser --superuser "$USER" and createdb "$USER" give you your own role and database.
  • CREATE DATABASE mandlas_walks OWNER walks_app; creates the Walk Office's database owned by its role.
  • In psql, \l lists databases, \c connects, \dt lists tables, \du lists roles and \q quits.
  • pg_lsclusters shows each cluster's version, port and status.
  • The PDO DSN is pgsql:host=localhost;port=5432;dbname=mandlas_walks.
  • php -S localhost:8000 -t stack-check serves the stack-check folder.

Rules and limits

  • On WSL, projects live in ~/projects, never under /mnt/c.
  • Install php8.5-cli and the extensions by name, never the plain php package, which brings Apache.
  • Run the Composer installer only after its SHA-384 checksum matches the published one.
  • Use sudo only to install software and change system settings, never for composer in a project.
  • Install postgresql-18 by number, and give the PGDG script noble on Linux Mint 22.
  • ~/.pgpass lines read host:port:database:user:password, and the file needs permissions 600.
  • No password belongs in code, notes or a Git repository.

Distinctions not to confuse

  • Peer authentication matches your Linux user name over a socket, while scram-sha-256 checks a password over TCP.
  • Without -h psql uses the socket, and with -h localhost it uses TCP.
  • psql --version is the client's version, and SHOW server_version; is the server's.
  • "Peer authentication failed" means the wrong kind of connection, while "password authentication failed" means a wrong password.
  • "could not find driver" means pdo_pgsql is missing, not that the database is down.