Radek S
Radek S

Reputation: 117

Cygwin and Xampp, wrong PHP is being used

I work on Windows and want to use some linux commands in console. I decided to install CygWin. I run my local server on Xampp.

When I open cygwin console and type php -v i see that is a version installed with cygwin. How to change configuration to cygwin use php from Xampp ?

I run Symfony project on local server and when I use xampp console all commands works fine, but when I open cygwin console and try to type some cmd for symfony there an error appear:

$ php app/console debug:router    

[Symfony\Component\Debug\Exception\ContextErrorException] Warning: date_default_timezone_get(): It is not safe to rely on the system' s timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those me thods and you are still getting this warning, you most likely misspelled th e timezone identifier. We selected the timezone 'UTC' for now, but please s et date.timezone to select your timezone.

I suppose that cygwin php is wrongly configured thats why I want to use PHP from xampp dir.

Upvotes: 1

Views: 1457

Answers (1)

Radek S
Radek S

Reputation: 117

I found answer somwhere else. Posting for others. Maybe someone will use this tip also.

The way to change PHP from CygWin default to Xampp one is to type in CygWin console a command:

export PATH=/cygdrive/c/xampp/php:$PATH

After that Cygwin use the PHP engine from Xampp

If u want to use this PHP everytime you can edit a CygWin file src/bash.bashrc

and at the end line add this

export PATH=/cygdrive/c/xampp/php:$PATH

Thats solved my problem and now I use much better Cygwin console for work.

Upvotes: 5

Related Questions