我正在尝试使用 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 变量
,请按照以下步骤操作:
- 右键单击
我的电脑
,选择属性
- 选择
高级系统设置
- 在
系统属性窗口
中单击环境变量按钮
。 - 选择
System Variables -> PATH
并单击 Edit。 - 输入您的
PHP.exe
所在的文件夹。
如果您这样做正确,请重新启动您的终端并输入 php --version
以检查它是否有效。
注意:不要忘记使用 ;
分隔符来分隔路径。
关于php : The term 'php' is not recognized as the name of a cmdlet, 函数、脚本文件或可运行程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19124930/