简体   繁体   中英

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.

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.

Here is what my PATH looks like inside of my .bash_profile:

/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:

-bash: php: command not found

When I try and run: php ./app/console from inside of my symfony root, I get:

-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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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