简体   繁体   English

PHP的路径“找不到命令”

[英]PATH for PHP “Command Not Found”

Forgive me for my ignorance here: I am coding in Symfony2 and I am trying to use the app/console commands to speed up development. 请原谅我在这里的无知:我正在使用Symfony2进行编码,并且尝试使用app / console命令来加快开发速度。

In any case I am using XAMPP for my local server and I am needing to specify where php is installed in my PATH to use app/console. 无论如何,我都将XAMPP用于本地服务器,并且需要指定PATH中安装php的位置才能使用应用程序/控制台。

Here is what my PATH looks like inside of my .bash_profile: 这是我的.bash_profile内的PATH的样子:

/opt/subversion/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Applications/XAMPP/xamppfiles/bin/php:/usr/local/git/binalias

But when I run php -v I get: 但是当我运行php -v我得到:

-bash: php: command not found

When I try and run: php ./app/console from inside of my symfony root, I get: 当我尝试从symfony根目录内部运行php ./app/console时,我得到:

-bash: php: command not found

If I run: 如果我运行:

 /Applications/XAMPP/xamppfiles/bin/php -v

I get: 我得到:

PHP 5.5.3 (cli) (built: Aug 26 2013 08:28:37) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies

Why is my PATH not working when I run, php ./app/console from inside of my Symfony directory. 为什么从我的Symfony目录内部运行php ./app/console时,我的PATH无法正常工作。

Any assistance would be GREATLY welcomed. 我们将竭诚欢迎任何帮助。 Thanks. 谢谢。

Your path is wrong: 您的路径错误:

/opt/subversion/bin/:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin:/Applications/XAMPP/xamppfiles/bin/php:/usr/local/git/binalias

This part: 这部分:

/Applications/XAMPP/xamppfiles/bin/php

Should be: 应该:

/Applications/XAMPP/xamppfiles/bin

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM