Bird
0
0

You installed PHP but when running php -v in the terminal, you get an error saying 'command not found'. What is the most likely cause?

medium📝 Debug Q14 of 15
PHP - Basics and Execution Model
You installed PHP but when running php -v in the terminal, you get an error saying 'command not found'. What is the most likely cause?
APHP is not installed or not added to system PATH
BThe PHP script has syntax errors
CThe web server is not running
DThe PHP file has wrong file extension
Step-by-Step Solution
Solution:
  1. Step 1: Understand the error message

    'command not found' means the terminal cannot find the PHP program to run.
  2. Step 2: Identify common causes

    This usually happens if PHP is not installed or its folder is not added to the system PATH environment variable.
  3. Final Answer:

    PHP is not installed or not added to system PATH -> Option A
  4. Quick Check:

    Command not found = PHP missing or PATH missing [OK]
Quick Trick: Check PHP installation and PATH if command not found [OK]
Common Mistakes:
  • Blaming syntax errors for command line issues
  • Thinking web server status affects terminal commands
  • Confusing file extension with command availability

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes