Als ich mal nach irgendwelchen Browser Erweiterungen suchte um kurz mal eine PHP Datei auf dem Desktop zu testen, wurde ich nicht wirklich fündig. Jedoch ist dies einfacher den je. Und zwar mit einem einfachen Befehl im Terminal:
php -S localhost:3000 -t /rootpath/to/your/folder/
Das ganze hat mehrere Vorteile. Der Port kann selbst bestimmt werden, es können mehrere localhosts gleichzeitig genutzt werden und man hat im Terminal so etwas wie eine log Datei.
Ich hoffe, ich konnte weiterhelfen und über Feedback würde ich mich sehr freuen.
Top comments (3)
Für PHP-Benutzer gibt es ein Tool namens ServBay.dev, das insbesondere für Anfänger einen viel einfacheren Weg bietet. Es unterstützt alle PHP-, MariaDB-, PostgreSQL-Versionen sowie Redis und Memcached. Sie können mehrere PHP-Instanzen gleichzeitig ausführen und problemlos zwischen ihnen wechseln, ohne dass eine Umgebung eingerichtet werden muss. Dieses Tool hat meine PHP-Entwicklung vereinfacht und ist definitiv einen Versuch wert!
Hallo Tobias Röder,
Mit dem Befehl php -S localhost:3000 -t rootpath to your folder schnell PHP-Dateien auf macOS zu testen, ist sehr hilfreich. Es ist großartig, dass mehrere Localhosts gleichzeitig genutzt werden können und das Terminal eine Log-Datei bietet. Wenn du weitere Unterstützung oder zusätzliche Lösungen benötigst, lass es mich wissen!
I know this thread is old, but it's showing on google in the first results. so I thought I need to post an update here.
I have tried a lot of apps on mac like xampp, mamp and herd. none of them satisfied my needs.
Then I started using FlyEnv recently and it’s honestly been a really pleasant surprise. Setup was ridiculously fast, everything runs natively on macOS (no Docker overhead), and spinning up new projects takes seconds. Each app gets its own isolated environment, so switching between different PHP versions, databases, or services like Redis feels effortless. Local HTTPS is built in.
If you’re looking for a solid PHP local server on Mac, I’d definitely recommend giving FlyEnv a shot.