skip to Main Content

I’m a begginer in Laravel and I installed XAMPP as local server. I noticed that my XAMPP already install php 7.4 as it’s dependency. But when I tried php -v in www dir in php it shown.

‘php’ is not recognized as an internal or external command, operable
program or batch file.

But in php directory is shown

PHP 7.4.15 (cli) (built: Feb 2 2021 20:47:45) ( ZTS Visual C++ 2017
x64 ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c)
Zend Technologies

So, should I install additional php in my system for development? Should the version of the php matche with XAMPP php 7.4?

2

Answers


  1. php -v will only tell you if you have PHP installed as a command line interface (PHP-CLI) which would enable you to run php code in cmd.exe or powershell. You’d normally not need this, but for reference here’s how to enable it: https://stackoverflow.com/a/10753133 (mind the comment on Windows 10).

    To check if PHP runs in your webserver environment (which is by default available in xampp), create a file test.php in your www folder with the following content:

    <?php
    phpinfo();
    ?>
    

    Call this file in a browser, you will get an overview of all php features available. Delete the file before you go productive, because it will also give hackers a lot of information (which you don’t want).

    Login or Signup to reply.
  2. Try to add XAMPP PHP to Environment Variables
    here is an instructions for Windows 10

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search