Created
December 21, 2023 14:04
-
-
Save lcloss/442425cfa1583757754a0c5d0a9c8e15 to your computer and use it in GitHub Desktop.
Start PHP server locally
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start a PHP server | |
# Usage: server.ps1 [port] | |
# Example: server.ps1 8000 | |
$port = 8000 | |
if ($args.Length -gt 0) { | |
$port = $args[0] | |
} | |
$cmd = "php -S localhost:$port" | |
Write-Host $cmd | |
Invoke-Expression $cmd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment