Home > Article > Backend Development > What should I do if the command line shows that php is not an internal command?
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.
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"
Select "Advanced" System Settings"
Select "Environment Variables"
Find the "Path" variable in the system variables and edit it
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
may still not be available, as shown below. Because I still need to restart php
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.
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!