Quick Install Guide for Apache+PHP+Firebird

This is a quick guide on how to install and configure Apache WWW Server, PHP and Firebird SQL server in a few easy steps on any Windows machine.

Download

FireBird – FirebirdSQL.org

Apache – httpd.apache.org
Alternate download for newest Apache builds: http://www.apachelounge.com

PHP – php.net. Get the .ZIP package, not the installer!!

Install

Firebird – Run Installer as service with all default options

Apache – Run Installer with all default options
Alternate-download install: Unzip package to “c:\apache24”

PHP – UnZip into C:\PHP (default in this guide)

Configure

Stop the Apache Service

Copy needed files

Copy the FBCLIENT.DLL file from the Firebird /bin directory to the Apache /bin directory:

COPY "C:\Program Files\Firebird\Firebird_2_5\bin\fbclient.dll" "C:\Program Files\Apache Software Foundation\Apache2.2\bin"

Edit the httpd.conf file

Edit the httpd.conf file, find line DirectoryExtension and set it as:

    DirectoryIndex index.php index.html

Add the following to Apache httpd.conf file (at the end). Directory by default is “C:\Program Files\Apache Software Foundation\Apache2.2\conf”

#
# PHP 5
#
LoadModule php5_module "c:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php
PHPIniDir "c:/php"

PHP Configuration

Create directory: “C:\PHP\Logs”

Rename C:\PHP\PHP.INI-PRODUCTION to C:\PHP\PHP.INI

Set ‘extension_dir’ to extension_dir = “C:\php\ext\”

Set ‘error_log’ to error_log = “C:\php\Logs\Errors.log”

Enable the following extension: extension=php_interbase.dll

Creating Virtual Hosts (Optional)

To Create Virtual Hosts on your local machine you need to configure the vhosts file and preferrably change the HOSTS file to include the domain name of your choice to point to the local IP address.

VHosts file

The VHosts file (httpd-vhosts.conf) is located in the Apache installation Directory, under “./conf/extras”.

Change the [domain] and [drive:path to domain root]

Add the following lines to the end:

<VirtualHost *:80>
    <Directory "[drive:path to domain root]">
        Options Indexes FollowSymLinks
        AllowOverride FileInfo
        Options None
        Order allow,deny
        Allow from all
    </Directory>

    ServerAdmin webmaster@[domain]
    DocumentRoot "[drive:path to domain root]"
    ServerName [domain]
    ErrorLog "logs/[domain]-error.log"
    CustomLog "logs/[domain]-access.log" common
</VirtualHost>

HOSTS file

Under windows the HOSTS file is found under “C:\Windows\System32\Drivers\Etc”. Please note that the path can be hidden.

Under Win Vista and newer you need to have admin rights or elevated rights for the user to change the file, so start your editor with “run as admin”

After changing your HOSTS file it should be like this (if you have the original file as base):

# localhost name resolution is handled within DNS itself.
# 127.0.0.1 localhost
# ::1 localhost
127.0.0.1 [domain]

Testing your setup

1) Enable the Apache Service

Open a CMD prompt, go to C:\apache24\bin and write "httpd.exe -k install"

2) Go to the /htdocs dir and create a phpinfo.php file, paste the following:

<?php
  phpinfo();
?>

3) Open your browser and enter http://127.0.0.1/phpinfo.php

There, You are Done!

Advertisements

3 thoughts on “Quick Install Guide for Apache+PHP+Firebird

  1. If you get an obscure error saying something about “cannot execute application because of an invalid sibe-by-side configuration” or something similar, then you need to download the CV++ redistributable packages from Microsoft. I had this problem on a Win2008R2 box.

    x86 versions:
    Microsoft Visual C++ 2005 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=3387
    Microsoft Visual C++ 2005 SP1 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=5638
    Microsoft Visual C++ 2008 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=29
    Microsoft Visual C++ 2008 SP1 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=5582
    Microsoft Visual C++ 2010 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=5555
    Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) – http://www.microsoft.com/en-us/download/details.aspx?id=8328

    x64 versions:
    Microsoft Visual C++ 2005 Redistributable Package (x64) – http://www.microsoft.com/en-us/download/details.aspx?id=21254
    Microsoft Visual C++ 2005 SP1 Redistributable Package (x64) – http://www.microsoft.com/en-us/download/details.aspx?id=18471
    Microsoft Visual C++ 2008 Redistributable Package (x64) – http://www.microsoft.com/en-us/download/details.aspx?id=15336
    Microsoft Visual C++ 2008 SP1 Redistributable Package (x64) – http://www.microsoft.com/en-us/download/details.aspx?id=2092
    Microsoft Visual C++ 2010 Redistributable Package (x64) – http://www.microsoft.com/en-us/download/details.aspx?id=14632
    Microsoft Visual C++ 2010 SP1 Redistributable Package (x64) – http://www.microsoft.com/download/en/details.aspx?id=13523

    If you get a message saying MSVCR110.DLL is missing, then you need to install the following:
    Visual C++ Redistributable for Visual Studio 2012 Update 3 – http://www.microsoft.com/en-us/download/details.aspx?id=30679

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s