php : The term 'php' is not recognized as the name of a cmdlet, 函数、脚本文件或可运行程序

标签 php windows git laravel laravel-4

我正在尝试使用 this 通过 Git Shell 安装和设置 Laravel 4教程:

这一切似乎都有效,直到我必须运行 php artisan key:generate 时它给了我错误:

php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program

我四处寻找,但不确定如何进行设置以使其识别 PHP。

有没有人有任何想法或知道有关设置 Laravel 4 的详尽教程?

最佳答案

尝试将您的 PHP.exe 文件夹添加到您的系统 PATH 变量,以便可以通过终端访问 PHP。

例如; C:\wamp\bin\php\php5.4.3

要添加新的 PATH 变量,请按照以下步骤操作:

  1. 右键单击我的电脑,选择属性
  2. 选择高级系统设置
  3. 系统属性窗口中单击环境变量按钮
  4. 选择 System Variables -> PATH 并单击 Edit。
  5. 输入您的 PHP.exe 所在的文件夹。

如果您这样做正确,请重新启动您的终端并输入 php --version 以检查它是否有效。

注意:不要忘记使用 ; 分隔符来分隔路径。

关于php : The term 'php' is not recognized as the name of a cmdlet, 函数、脚本文件或可运行程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19124930/

相关文章:

php - 将复选框数组中的数据插入 MySQL

java - 提高在 Windows 上使用映射网络驱动器时的 java 文件 I/O 性能

git - 钢筋无法从github获得依赖

git - GitLab 上的修补程序

git - 重写整个 git 历史

php - Sphinx 不从结果中返回 ID

php - 上传表单中的空字节注入(inject)

C++ 将全局列表传递给线程

java - 'keytool' 未被识别为内部或外部命令

php - Mysql 查询另一个表上的计数