Skip to content

Instantly share code, notes, and snippets.

@szepeviktor
Created July 29, 2025 07:52
Show Gist options
  • Save szepeviktor/4d88726b0f990cacc681cec29869f1bf to your computer and use it in GitHub Desktop.
Save szepeviktor/4d88726b0f990cacc681cec29869f1bf to your computer and use it in GitHub Desktop.
Switch PHP version for a user in Debian
#!/bin/bash
mkdir -p /usr/local/bin/php8.3
ln -s /usr/bin/php8.3 /usr/local/bin/php8.3/php
# Add this to your script: export PATH="/usr/local/bin/php8.3:$PATH"
@szepeviktor
Copy link
Author

szepeviktor commented Jul 29, 2025

$ php -v
PHP 8.4.10 (cli) (built: Jul  3 2025 12:45:15) (NTS)

$ PATH="/usr/local/bin/php8.3:$PATH" php -v
PHP 8.3.23 (cli) (built: Jul  3 2025 16:20:45) (NTS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment