Thursday, October 2, 2008

Install PHP 5 on Windows Xp for IIS 5.1

Step by step guide to install IIS and PHP 5 on windows XP:

  1. First install IIS server:
      • Go to your control panel > add remove programs. Click on "Add/Remove Windows Components".
      • Make sure windows CD is inserted
      • Place a Select check for "Internet Information Services (IIS)”
      • Continue with the installation completely.
  1. Check whether IIS is installed properly by browsing the default iis site (http://localhost).
  1. Now you must get the correct files for php5. Head over to http://www.php.net/downloads.php and download the zip package under "Windows Binaries" Do not get the installer! In addition, while you are here you will need to get the "Collection of PECL modules" also under Windows Binaries
  2. Once Downloaded extract the first file you downloaded and place the files in "C:\php". Extract the PECL modules to "C:\php\ext".
  3. Rename C:\php\php.ini-recommended to C:\php\php.ini and then COPY it to C:\Windows
  4. Open both the php.ini file you have now and uncomment cgi.force_redirect in php.ini and set it to 0
  5. Change session.save_path as "session.save_path=C:\php\sessions" and make the directory C:\php\sessions
  6. Set the line "extension_dir" as "extension_dir = "C:\php\ext".
  7. Uncomment all of the following items.
    extension=php_mssql.dll
    extension=php_msql.dll
    extension=php_mysql.dll
    extension=php_mysqli.dll
    extension=php_java.dll
    extension=php_ldap.dll
    extension=php_iisfunc.dll
    extension=php_imap.dll
    extension=php_filepro.dll
    extension=php_gd2.dll
    extension=php_gettext.dll
    extension=php_dba.dll
    extension=php_dbase.dll
    extension=php_dbx.dll
    extension=php_mbstring.dll
    extension=php_pdf.dll
    extension=php_pgsql.dll
    extension=php_sockets.dll
    extension=php_xmlrpc.dll
    extension=php_xsl.dll
    extension=php_zip.dll
  8. Now copy all of those DLL files in C:\php\ext to C:\windows\system32 or add "C:\PHP;" to your Windows path:
      • Right Click on My Computer and choose properties > Advanced Tab > Click "Environment Variables".
      • Now add "C:\PHP;" to the very beginning.
      • Now go to start > run > type: regedit and click ok
      • Add HKEY_LOCAL_MACHINE\SOFTWARE\PHP\IniFilePath = C:\php to the registry. If you change your windows path instead of copying the dll files then you will need to restart your computer before php will work. Updating php is easier when you add it to your Windows path. So bookmark this page and go restart. Now is the best time since we are done with file placement.
  1. You might have to restart your system at this point
  2. Ok, you are back. Now it is time to let IIS know that you have php and you are going to tell IIS how to use it and when
  3. Open Internet Services Manager in your Administrative Tools in the start menu
  4. Right Click on Web Sites and click Properties, go to ISAPI filter tab choose Add, Filter Properties window pops up. Enter

    Filter Name: php

    Executables: Browse to C:\php\php5isapi.dll

  1. Right Click on websites and choose properties. Go to the Documents tab and add index.php as a start document.
  2. Go to C:\Inetpub\wwwroot and delete everything in there except for aspnet_client. Now make a new text file and name it phpinfo.php. Open it up with your text editor ant put this in it: .
  3. Open a web Browser and go to http://127.0.0.1/phpinfo.php
  4. Enjoy php on Windows XP and IIS

Wednesday, January 9, 2008

Interactive Voice Response (IVR)

Interactive Voice Response (IVR).

Interactive Voice Response (IVR) is the technology that let you interact with a menu using a touch-tone telephone. In our day to day life we have already come across IVR in many ways, a best example is when you call banks

It is very easy to set-up such a menu with Asterisk.

The following is just an example for an IVR system where you call the number 9877777777 and you enter the IVR system. First you will get the greeting message ("welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for Credit card Enquiry or press 9 to talk to pur representative") and during this message you can press key 1, 2 or 9. According to the number pressed, you will be directed to the right extension

In extensions.conf place this snippet

exten => 9877777777,1,Answer
exten => 9877777777,2,SetMusicOnHold(default)
exten => 9877777777,3,DigitTimeout,5
exten => 9877777777,4,ResponseTimeout,10
exten => 9877777777,5,Background(greeting)

;; greeting -- "welcome to dash dash Bank, please press 1 for Account related Enquiry, 2 for ;;Credit card Enquiry or press 9 to talk to pur representative

exten => 1,1,Playback(ivr1) ; takes to another Account related IVR

exten => 2,1,Playback(ivr2) ; takes to another Credit card related IVR

exten => 9,1,Playback(representative)
exten => 9,2,Dial(SIP/bankrep)
;; representative -- Please wai while the call is transfered to our representative