Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am having an issue with running a PHP project called Phing with Cygwin. It's not a huge problem because I can make it work but I am looking for a reason or a fix so I can do it differently.

In order to have Phing work with Cygwin on my system, I must add some paths to the windows 7 environment variables through the control panel

At first I had to add 4 variables.

PHP_COMMAND = /cygdrive/e/Server/php/php.exe
PHING_HOME = E:\Server\phing
PHP_CLASSPATH = E:\Server\phing\classes
PATH : add this to the end ;E:\Server\phing\bin

What I would rather do though it add these into my .bash_profile under cygwin/home/jason/.bash_profile

Now I was able to successfully add 3 out of the 4 items to my bash_profile


and then I had to still add PHING_HOME=:E:\Server\phing to my windows Environment Settings

Now I am not sure why though, when I try to add the PHING_HOME path to my bash_profile and then run phing inside cygwin then I get this error...

Could not open input file: /cygdrive/e/Server/phing/bin/phing.php

As long as I keep PHING_HOMEas a Environment Variable then phing runs fine.

So does anyone have any idea why this 1 variable has to be in the Environment Variables in control panel instead of inside my CYGWIN .bash_profile file?

share|improve this question
Have you compared the value of PHING_HOME as seen by the Cygwin shell in the two different scenarios? – Harry Johnston Dec 5 '11 at 3:36
up vote 1 down vote accepted

That is an odd one. I suggest adding

set -x

at the top of your .bash_profile. That will make bash print a listing of each following command that's being executed. By looking at what was happening right before the error message, you should be able to figure out what command is getting confused by PHING_HOME. (After the shell starts, you can turn the debugging output back off again with set +x.)

share|improve this answer
Thanks for the tip, I tried that, it is strange because this shows that PHING_HOME=:/cygdrive/e/Server/phing is set correctly however the phing program will only work if it is added in through the control panel still, strange – JasonDavis Dec 4 '11 at 23:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.