Resolving "PHP Not Found" Error With XAMPP On MacOS
Fix "PHP not found" error on macOS: Add XAMPP's PHP to your shell's PATH by editing .zshrc (for zsh users) or .bash_profile (for bash users), then restart terminal. Alternatively, install PHP with Homebrew for a system-wide installation.
If you’re a developer working on macOS and you’ve installed XAMPP to set up your local development environment, encountering the “PHP not found” error can be frustrating. Even though XAMPP includes PHP, your terminal might still not recognize the php command. This article walks you through how to resolve this issue step by step and ensure your system knows where to find PHP. Understanding the Error When you run the following command: php -v and get an error message like this: php not found it means your system’s shell (like zsh o...