Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is installing PHP on Cygwin just like it being on a real Linux server?

I currently use XAMPP on Windows 7 for my dev server which is a LAMP stack.

I recently installed cygwin and have been messing around with it. I am just curious, with cygwin since it is like unix/linux does that mean that you can install apache and php just as if you were installing it on a Linux server? I know you can install them on cygwin as I saw them in a package list but I'm not sure if this is the same as if I was installing it on a real production linux server?

From what I read cygwin mimics unix/linux on windows.

like image 643
JasonDavis Avatar asked Dec 04 '11 13:12

JasonDavis


People also ask

Is PHP installed on Linux?

There are several possibilities to check and validate PHP version on Linux. 1. Open a bash shell terminal and use the command “php –version” or “php -v” to get the version of PHP installed on the system. As you can see from both the command output above, the system has PHP 5.4.

Do I need to install PHP after Apache?

You can install PHP on the CLI without having Apache installed, but if you want to add PHP support to Apache you have to have it installed first. You can install MySQL before or after the Apache installation.

Is Cygwin still supported?

As of the creation of this article: Red Hat Cygwin is supported on all 32- and 64-bit versions of Windows since 2003 Server. Cygwin is available as both a 32- and 64-bit platform supporting 32 on 32-bit, 32 on 64-bit, and 64 on 64-bit installations.


3 Answers

The old question (and old answers) are still functional these days. However, I thought it'd be worth to add that, right now (June 2017), this became much simpler under Cygwin. Don't know if it has to do with Apache or PHP 7 changing something, but anyway I didn't have to follow lots of tutorials for my initial configuration.

Now it's really just a matter of running Cygwin setup, and selecting packages httpd, php, httpd-mod_php7, php-mysqli and mysql-server (in fact, some additional dependent packages will also be selected by Cygwin - and it will ask you for your confirmation, as you might already know).

When you next go to Cygwin console, you just need to apachectl start, and there it is readily available on port 80. If you need it as an all-time available server, configuring server is still the same with cygserver-config.

No apt-cyg needed, or importing packages from Cygwin Ports - although it's also great and still works beautifully. It just became a bit simpler.

like image 178
Charles Roberto Canato Avatar answered Sep 25 '22 03:09

Charles Roberto Canato


Install cygwin

with the following packages:

  1. gawk, (default install)
  2. tar, (default install)
  3. bzip2, (default install)
  4. wget,
  5. subversion,
  6. mail,
  7. sSMTP,
  8. util-linux,
  9. ncurses,
  10. openSSH,
  11. cygrunsrv,
  12. apache2
  13. and MySQL
  14. apt-cyg

Install php

install PHP using:

apt-cyg -m ftp://ftp.cygwinports.org/pub/cygwinports/ install php

and also

apache2-mod_php5
php-mysql
php-mysqli
php-PEAR

Configuring Servers

/usr/bin/cygserver-config
like image 30
RafaSashi Avatar answered Sep 25 '22 03:09

RafaSashi


It highly depends on your production needs, but after all cygwin is just an emulation-layer and nothing more. It does an incredible job but its hard for me to believe its hardly as reliable as a Unix box.

You can read more about it in this slashdot thread: http://ask.slashdot.org/story/04/08/12/1932246/cygwin-in-a-production-environment

Shai.

like image 30
Shai Mishali Avatar answered Sep 27 '22 03:09

Shai Mishali