I am having a lot of difficulty routing PHP to cygwin.
My goal is simply to run the following PHP test command successfully:
php -v
I'm currently getting the following error: -bash: php: command not found
This is what I tried in the .bash_profile
document:
PATH = $PATH:/xampp/php
export PATH
I am using xampp and my php.exe
is in the following path C:/xampp/php/php.exe
, also I noticed there isn't a bin
directory in my php
directory. There is a bin
directory in C:/xampp/apache
perhaps this is the one I should link to? I tried this as well with no success.
In Cygwin you windows C drive is mounted to /cygdrive/c/
so if you wanted to add C:/xampp/php/
to your path, then you should add the following to your .bashrc
:
export PATH=$PATH:/cygdrive/c/xampp/php
What @flungo wrote was absolutely correct:
I have to add this line to C:\cygwin64\etc\bash.bashrc in order for each new cygwin terminal to have the correct $PATH
export PATH=$PATH:/cygdrive/c/xampp/php
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With