Installing mod_fastcgi Apache on Windows

October 17th, 2008

This installation assumes installed Apache. Here you go:

  1. Download mod_fastcgi dll from http://www.fastcgi.com/dist/.
  2. Copy the dll into c:\program files\apache software foundation\apache2.2\modules\ (if you are using default installation directory) and rename it to mod_fastcgi.dll.
  3. Edit httpd.conf and add the following line:
    LoadModule fastcgi_module modules/mod_fastcgi.dll
  4. Restart Apache.

Installing mod_python apache on windows

October 17th, 2008

To install and test mod_python Apache on Windows (assuming that you’ve already had Apache and Python installed):

  1. Download mod_python Win32 Binaries from http://httpd.apache.org/modules/python-download.cgi
  2. Run the installer. When prompted for Apache installation directory, type C:\Program Files\Apache Software Foundation\Apache2.2 (Assuming default Apache installation).
  3. Edit httpd.conf.
  4. Add the following line:
    LoadModule python_module modules/mod_python.so
  5. Configure your Apache <Directory> directives to include AddHandler, PythonHandler, and PythonDebug (examples below).

To test your mod_python installation:

  1. Create a file named mptest.py in say C:\sites.
  2. The file will contain:
    from mod_python import apache
    def handler(req):
      req.content_type = ‘text/plain’
      req.write(”Hello World”)
      return apache.OK
  3. Edit httpd.conf.
  4. Under <Directory “C:/sites”> directive add:
    AddHandler mod_python .py
    PythonHandler mptest
    PythonDebug On
  5. Restart Apache and point your browser to the mptest.py url.

Installing phpmyadmin on windows

October 11th, 2008
  1. Download the latest version of phpMyAdmin from http://www.phpmyadmin.net/home_page/downloads.php.
  2. Extract the content to your desired installation location. (I will use D:\sites\phpmyadmin for this article).
  3. Edit httpd.conf (Apache) to setup a virtual host by adding
    NameVirtualHost *:80
  4. <VirtualHost *:80>
    DocumentRoot “D:/sites/phpMyAdmin”
    ServerName phpMyAdmin
    <Directory “D:/sites/phpMyAdmin”>
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
        </Directory>
    </VirtualHost>
    lines to the bottom of the file.

  5. Restart Apache.
  6. Navigate to phpmyadmin installation directory and copy the file config.sample.inc.php to config.inc.php and edit it as you desired (or download mine here).
  7. You need to enable a few extensions (edit php.ini) in order to use phpmyadmin. Here’s a few:
    extension=php_mysql.dll
    extension=php_mysqli.dll
    extension=php_mcrypt.dll
  8. Since you are using virtual host, you need to edit your hosts file (%SystemRoot%\system32\drivers\etc\hosts).
    127.0.0.1 phpMyAdmin
  9. Point your browser to http://phpMyAdmin/ .
  10. You should now be able to login.
  11. Navigate to Import tab.
  12. Click Choose File.
  13. On the popup box, navigate to D:\sites\phpmyadmin\scripts and select create_tables.sql. SQL commands should successfully execute.
  14. Now, navigate to SQL tab.
  15. Type: grant all on pmadb.* to ‘pma’@'localhost’ identified by ‘pmapass’.
  16. Click Go.
  17. You are all set to use phpMyAdmin now.

Installing php on vista (And configure APACHE)

October 10th, 2008

Apache installation on Vista is a breeze. Just use the installer downloaded from http://httpd.apache.org/download.cgi.

If you are looking steps to install PHP using MSI Installer, this isn’t for you. I have tried installing PHP using MSI installer on Vista, and it was a pain. So I decided to manually install and setup the PHP environments.

Below are the steps:

  1. Download PHP Windows Binaries from http://www.php.net/downloads.php#v5 (zip package).
  2. Unzip them to your desired location. I recommend not to install PHP on the partition where your Vista resides (e.g. D:\PHP) to avoid UAC annoyance.
  3. Click on “Vista” icon (or “Start” button) on your desktop, right click on Computer and select Properties. Click on Advanced system settings.
  4. A dialog box pops up. Click on Environment Variables.
  5. Under System Variables scroll to find Path variable. Select and click Edit…
  6. Append your PHP path (e.g. D:\PHP) to the beginning of Variable value. Don’t forget to insert ; after it. And save it.
  7. Under System Variables click New…
  8. Variable name: PHPRC, Variable Value: D:\PHP. And save it.
  9. And just click OK buttons all the way to close all the dialog boxes.
  10. Open a Command Prompt and execute “php -v” to see if PHP is correctly installed.
  11. Edit php.ini file (under D:\PHP) and set your extension_dir to “./ext”.
  12. Edit httpd.conf (Apache’s) and add
    LoadModule php5_module “D:/PHP/php5apache2_2.dll”
    AddType application/x-httpd-php .php

    line to the bottom of the file.