0

I am running Windows 7. I have XAMPP for my Dev server. I also have a PHP command line tool called Phing which is a build script.

Using the Windows command prompt I can cd to my directory that has a build file and then just run the cammand phing and it will build my files.

Now I just installed CYGWIN for Windows and when I do the same process I get

Jason@Jason-Quad-PC /cygdrive/e/Server/htdocs/myframework/buildscript/build
$ phing
-bash: phing: command not found

So is there a way to get all my Windows stuff to work with CYGWIN like PHP and Phing?

JasonDavis
  • 2,658
  • 6
  • 25
  • 32

1 Answers1

1

I misread your question initially, phing I guess is not in /cygdrive/e/Server/htdocs/myframework/buildscript/build

You need to make sure the location of phing is in your Cygwin PATH.

Edit ~/.bash_profile (assuming you're using bash) and add another line at the bottom like this,

PATH=${PATH}:/full/path/to/phingdirectory

then start a new shell under Cygwin and try again.

If phing is in /cygdrive/e/Server/htdocs/myframework/buildscript/build and you're trying to execute it from there, then you need to know that Unix like operating system shells do not tend to look in the current directory for programmes to run, they only check the path.

To change that behaviour you need to add the local directory to the path like this,

PATH=${PATH}:.

or run the programme like this,

$ ./phing
EightBitTony
  • 9,311
  • 1
  • 34
  • 46
  • Hi thanks for the response, the Phing is actually a PEAR package. I installed Cygwin in `C:\cygwin` and my PHP and Phing is over at `E:\Server\php\pear` My LAMP setup is using XAMPP so maybe I can't access my current PHP and Apache installation with Cygwin without reinstalling. – JasonDavis Dec 03 '11 at 19:47
  • Just to add, I just ran `php -i` and it showed info from PHP inside cygwin so with that working I think Phing should be do-able – JasonDavis Dec 03 '11 at 20:10
  • Have you tried executing Phing by using the full path to the actual Phing script/binary. That's the first test. If that works, the only issue is your path. – EightBitTony Dec 04 '11 at 09:17
  • I was able to get it working, it was the PATH but I had to add it under the windows control panel settings as an environment variable, I wasn't sure what PATH meant before – JasonDavis Dec 04 '11 at 10:19
  • Yes, you can set it there and the Cygwin shell inherits it, or you can add your own PATH values in your .bash_profile, no one way of doing things (typical UNIX ;)) – EightBitTony Dec 04 '11 at 11:02
  • good to know I would prefer the .bash_profile method so thanks for that – JasonDavis Dec 04 '11 at 11:53
  • I have removed the environment variable and added it to my `.bash_profile` but it does not work, `bash: phing: command not found` any ideas what could be wrong? the EV was set to `E:\Server\phing\bin` so I removed and added to the bash_profile this `PATH=${PATH}:E:\Server\phing\bin` – JasonDavis Dec 04 '11 at 12:06
  • Ah got it to work in the profile now, I had the `/` instead of `\` – JasonDavis Dec 04 '11 at 14:58