Home  >  Article  >  Backend Development  >  What should I do if the command line shows that php is not an internal command?

What should I do if the command line shows that php is not an internal command?

藏色散人
藏色散人Original
2021-12-17 10:55:406365browse

Solution to the command line displaying that php is not an internal command: 1. Right-click the computer and select "Properties"; 2. Find and select "Environment Variables"; 3. Find the "Path" variable in the system variables ;4. Enter the directory where PHP is located.

What should I do if the command line shows that php is not an internal command?

The operating environment of this article: Windows 7 system, Laravel version 5.8.1, Dell G3 computer.

What should I do if the command line shows that php is not an internal command?

An error may occur when using the command prompt to check the laravel version:

'php' 不是内部或外部命令,也不是可运行的程序 或批处理文件。

It is usually because the environment variables are not set.

Method

Right-click Computer or My Computer and select "Properties"

What should I do if the command line shows that php is not an internal command?

Select "Advanced" System Settings"

What should I do if the command line shows that php is not an internal command?

Select "Environment Variables"

What should I do if the command line shows that php is not an internal command?

Find the "Path" variable in the system variables and edit it

What should I do if the command line shows that php is not an internal command?

Add an English semicolon and enter the directory where PHP is located.

After editing is completed, remember to click OK to save the modified variables

What should I do if the command line shows that php is not an internal command?

may still not be available, as shown below. Because I still need to restart php

What should I do if the command line shows that php is not an internal command?

laragon. The newbie couldn’t figure out how to re-run php, so I just restarted the computer. After restarting, check the laravel version and you can see that you can use the php command.

What should I do if the command line shows that php is not an internal command?

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What should I do if the command line shows that php is not an internal command?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn