php : The term #39;php#39; is not recognized as the name of a cmdlet, function, script file, or operable program(php : 术语“php未被识别为 cmdlet、函数、脚本文件或可运行程序的名称)
问题描述
我正在尝试使用 这个教程:
I am trying to install and setup Laravel 4 through the Git Shell using this tutorial:
这一切似乎都在工作,直到我必须运行 php artisan key:generate 时它给了我错误:
It all seems to be working until I have to run php artisan key:generate at which point it gives me the error:
php : 术语php"未被识别为 cmdlet、函数、脚本文件或可运行程序的名称
php : The term 'php' is not recognized as the name of a cmdlet, function, script file, or operable program
我四处寻找,但不确定如何设置它以识别 PHP.
I have hunted around and am not sure how to go about setting this up so it recognizes PHP.
有没有人有任何想法或知道设置 Laravel 4 的完整教程?
Does anyone have any ideas or know of a thorough tutorial to get Laravel 4 setup?
推荐答案
尝试将 PHP.exe 的文件夹添加到 System PATH variables,这样 PHP 就可以通过终端访问.
Try adding your PHP.exe's folder to your System PATH variables, so PHP can be accessed via terminal.
例如;C:wampinphpphp5.4.3
要添加新的 PATH 变量,请按照以下步骤操作:
To add new PATH variable, follow this:
- 右击
我的电脑,选择属性 - 选择
高级系统设置 - 在
系统属性窗口点击环境变量按钮. - 选择
系统变量->PATH并点击编辑. - 输入你的
PHP.exe所在的文件夹.
- Right click on
My Computer, selectProperties - Select
Advanced System Settings - In the
System Properties windowclick theEnvironment Variables button. - Select
System Variables -> PATHand click Edit. - Enter the folder where your
PHP.exeis located.
如果您正确执行此操作,请重新启动终端并键入 php --version 以检查它是否有效.
If you did this correctly, restart your terminal and type php --version to check if it works.
注意:不要忘记使用 ; 分隔符来分隔路径.
Note: Don't forget to seperate paths by using ; seperator.
这篇关于php : 术语“php"未被识别为 cmdlet、函数、脚本文件或可运行程序的名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:php : 术语“php"未被识别为 cmdlet、函数、脚本文件或可运行程序的名称
基础教程推荐
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
