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

坚强是说给别人听的谎言 提交于 2020-06-25 09:01:26

问题


I am trying to install and setup Laravel 4 through the Git Shell using this tutorial:

It all seems to be working until I have to run php artisan key:generate at which point it gives me the error:

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

I have hunted around and am not sure how to go about setting this up so it recognizes PHP.

Does anyone have any ideas or know of a thorough tutorial to get Laravel 4 setup?


回答1:


Try adding your PHP.exe's folder to your System PATH variables, so PHP can be accessed via terminal.

For example; C:\wamp\bin\php\php5.4.3

To add new PATH variable, follow this:

  1. Right click on My Computer, select Properties
  2. Select Advanced System Settings
  3. In the System Properties window click the Environment Variables button.
  4. Select System Variables -> PATH and click Edit.
  5. Enter the folder where your PHP.exe is located.

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.



来源:https://stackoverflow.com/questions/19124930/php-the-term-php-is-not-recognized-as-the-name-of-a-cmdlet-function-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!