Gareth Hunt Firefox Addons, Mobile Web and living in the USA

6Feb/087

PHP and Cygwin

I've been having some problems with PHP and Apache 2 on windows recently. I would be doing some development work and refreshing the page to test progress and after some short time Apache would stall and require a restart. I tracked the problem down to using the binary module that comes with PHP. If that module was removed from the Apache configuration, the webserver would be just fine - but without PHP running.

So, I took a look at cygwin to see whether PHP could be made to work with it. I already had the Apache 2 webserver package installed, so all I needed was PHP. Looking at the official PHP packages, there is no support for PHP. After some searching around the net I found a blog called Cygwin Ports. This is linked to a sourceforge project and it has a PHP 5.2.5 package for cygwin.

Installing packages from Cygwin Ports was as easy as adding the URL ftp://sourceware.org/pub/cygwinports to the cygwin server list. So, I followed the instructions for including their package, installed PHP and wrote a quick test script using only phpinfo():

<?php phpinfo(); ?>

I typed http://localhost/index.php and Success!

The next step was to get something more complex working, specifically CMS Made Simple. But I'll leave that for next time.

ftp://sourceware.org/pub/cygwinports

Filed under: cygwin, php Leave a comment
Comments (7) Trackbacks (0)
  1. Hi Gareth,

    For the installation, I followed everything as mentioned at
    http://www.mail-archive.com/cygwin-ports-general@lists.sourceforge.net/msg00234.html
    but my index.php which contains phpinfo() does not work.

    Is there anything else that I should pay attention to?

    Thanks.

  2. Assuming you are using the Apache webserver, double check your apache.conf and make sure you have the correct directives. Here is a good reference: http://www.alt-php-faq.org/local/2/

    If all looks ok, check your error.log for any messages indicating the problem.

  3. sunsite.dk seems to be dead.
    You should now use ftp://sourceware.org/pub/cygwinports

  4. Saggi, thanks for the updated URL. I’ve modified the post.

  5. FYI, cygwin setup tells me ftp://sourceware.org/pub/cygwinports has a corrupt setup.ini, assumes it’s a corrupt mirror, and won’t connect to it.

  6. I suggest trying again in a few days and see if it has resolved itself. If not, get in touch with the cygwinports project to ask for help.


Leave a comment


*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

No trackbacks yet.