CCelestiallines.com

PHP Articles

Notes on PHP, Drupal, Laravel, React, and Next.js development.

PHP Security Best Practices: Preventing SQL Injection, XSS, and CSRF

Jun 2026

PHP Security Best Practices: Preventing SQL Injection, XSS, and CSRF

The PHP security fundamentals that actually stop real-world attacks: prepared statements for SQL injection, output-context escaping for XSS, CSRF tokens, proper password hashing, safe file upload handling, and keeping dependencies patched.

Read more →
Composer Autoloading Explained: PSR-4 vs Classmap

Jun 2026

Composer Autoloading Explained: PSR-4 vs Classmap

PSR-4 vs classmap vs 'files' autoloading in Composer, dev-only autoload mappings, production autoloader optimization flags (-o, --classmap-authoritative), and why 'class not found' resurfaces after adding new classes.

Read more →
PHP vs Node.js: Which Should You Choose in 2026?

Jun 2026

PHP vs Node.js: Which Should You Choose in 2026?

PHP vs Node.js compared honestly: execution model differences (shared-nothing vs event loop), where each still wins in 2026, performance realities versus benchmark hype, and a practical decision framework rather than a popularity verdict.

Read more →
How to Fix the 'Class Not Found' Error in PHP

Jun 2026

How to Fix the 'Class Not Found' Error in PHP

Every real cause of PHP's 'Class not found' error — stale Composer autoload cache, missing use statements, PSR-4 namespace/folder mismatches, files outside any autoload map, Linux case sensitivity, and stale opcache — plus a systematic way to diagnose it.

Read more →
PHP Design Patterns Every Developer Should Know

Jun 2026

PHP Design Patterns Every Developer Should Know

Six PHP design patterns that actually earn their keep in real codebases — Singleton, Factory, Strategy, Repository, Observer, and Decorator — with working code and honest guidance on when each is worth the complexity versus over-engineering.

Read more →
How to Debug PHP with Xdebug in VS Code

Jun 2026

How to Debug PHP with Xdebug in VS Code

Setting up Xdebug 3 with VS Code end to end: php.ini config, the PHP Debug extension, launch.json, debugging inside Docker/DDEV and WSL specifically, conditional breakpoints and logpoints, and the connection issues people actually hit.

Read more →