Web Server @ Home – Installing PHP

Web Server @ Home is where this series commenced. This is follow up in same series. Please Read following for installing Apache2, Cygwin & MySQL.

PHP is one of the most widely used scripting language on Web. PHP official site is located at http://www.php.net. According to http://www.php.net

What is PHP?
PHP (recursive acronym for "PHP: Hypertext Preprocessor") is a widely-used Open Source general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.

It is so popular that Usage Stats for March 2006 is 21,439,178 Domains and 1,277,736 IP Addresses!!

Following is installation procedure for PHP on Cygwin/Windows XP.

Please Note: This section discuss information, specific  to SVTechie.COM only. Your requirement may differ significantly, hence please use any information , presented here on your own risk. This website and author are no way responsible for damage caused.

Acknowledgement : http://www.cygwin.com/ml/cygwin/2005-12/msg00093.html

  • Make sure resolv (Part of minires module – also install minires-devel module) is installed.
  • This was not included during Cygwin Installation but is needed for PHP installation
  • download and unpack php-5.1.2.tar.gz; it will unpack php-5.1.2 directory. (tar xvfz php-xxx.tar.gz)
  • cd php-5.1.2 & Run following command

configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –without-pear –enable-mbstring

OR 

configure –prefix=/usr/local/php –with-apxs2=/usr/local/apache2/bin/apxs –without-pear –enable-mbstring –with-mysql-dir={your mysql installation} –with-zlib

  • Above may not work and needed to be fixed. Major issue is that in Apache2 build, server executables have name  httpd.exe but since it is apache2, script looks for httpd2.exe. Modify apxs to point to correct location.
  • Open the Makefile and make the following changes:
  • Add  following to "EXTRA_LIBS":

 -lhttpd2core -lapr-0 -lapr-1 -laprutil-0 -laprutil-1

  • In the section libs/libphp5.bundle: add -shared after $(CC):

$(CC) -shared $(MH_BUNDLE_FLAGS) $(CFLAGS_CLEAN) […]

  • In the same line replace$(PHP_GLOBAL_OBJS:.lo=.o) $(PHP_SAPI_OBJS:.lo=.o) by

`echo $(PHP_GLOBAL_OBJS) $(PHP_SAPI_OBJS) | sed "s/\([^/ ]*\)\.lo/.libs\/\1.o/g"`

  • Copy <apache-install>/lib/libhttpd2core.* into /lib 
  • Make & Install
  • make
  • make libs/libphp5.bundle
  • cp libs/libphp5.so <apache-install>/modules/cygphp5.so
  • make install

    So finally WCAMP is done Smile

    WCAMP: Windows, Cygwin, Apache, MySQL, PHP

    Leave a Reply

    Your email address will not be published. Required fields are marked *