Instant PHP and XDebug on Docker

A while back I wrote a little helper script I could stick in my Linux shell which will just spin up whatever directory I'm in as an Apache server running PHP and XDebug, with a self-signed TLS certificate.

It's very useful when the built-in PHP server (php -S) just isn't enough, or I want to run a specific version of PHP.

It works like this:

cd /my/php/project/
php_here 8.1

And that's it, I can go hit up https://localhost:4430 or http://localhost:8080 and whatever's in my current directory is mounted inside Apache.

Anyway, just thought I'd share 🙂 in case anyone else finds it useful. You can find the tool here:


Add a comment

All comments are pre-moderated and will not be published until approval.
Moderation policy: no abuse, no spam, no problem.

You can write in _italics_ or **bold** like this.

Recent posts

Monday 28 August 2023, 11:26

Why type hinting an array as a parameter or return type is an anti-pattern and should be avoided.


Saturday 17 June 2023, 15:49

Leveraging the power of JSON and RDBMS for a combined SQL/NoSQL approach.



Buy this advertising space. Your product, your logo, your promotional text, your call to action, visible on every page. Space available for 3, 6 or 12 months.

Get in touch

Saturday 13 May 2023, 01:16

Musings from a Reddit thread


Monday 10 April 2023, 00:11

Life with a newborn baby aka why I sometimes go long periods of time without making any new posts.


Sunday 09 April 2023, 22:56

Maximise performance with load once scripts, kept in long-running memory