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:

https://github.com/dwgebler/php_docker_helper


Comments

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


Sunday 01 December 2024, 18:37

Re-examining this famous puzzle of probability and explaining why our intuitions aren't correct.

musings

Sunday 17 November 2024, 22:53

Keep your database data secure by selectively encrypting fields using this free bundle.

php

SPONSORED AD

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

Sunday 27 October 2024, 19:02

Learn how to build an extensible plugin system for a Symfony application

php

Saturday 10 February 2024, 17:18

The difference between failure and success isn't whether you make mistakes, it's whether you learn from them.

musings coding

Monday 22 January 2024, 20:15

Recalling the time I turned down a job offer because the company's interview technique sucked.

musings