HW3php  Installation (All Platforms)

NOTE: The following covers the installation of HW3php on All Platforms.

Installation : STEP 1 : Uncompressing the package.

The first step is to download the "zip" distribution of HAMweather 3 from the HAMweather Download Site and decompress the software package.  Once unzipped you should have one directories, "hw3php" and the files "readme.txt" and "license.txt".

zip Distribution (Windows servers usually or if you plan on uploading the individual files via FTP to your server)

tar.gz Distribution (UNIX/LINUX servers usually)

Installation : STEP 2 : Setup the hw3.php

With the software package uncompressed it is now time for the hardest step of the installation process.  Under normal default usage you should be able to skip this step and move on to Step 3. Normally this step is only needed if you are going to put the hw3.php into a different directory than where the core distribution directory structure is uploaded.

Changes to the hw3.php
  1. File Path to the core HW3 directory structure

    If you are installing the main hw3.php into a different directory than the core directory structure then you will need to make one (1) change to the hw3.php file:

You will now need the relative or full path name to the directory where the HW3 core directory structure is installed on the server.  This is not the URL and does not include "http://."  

   For Example:  On UNIX the path may look like:


   and on a Windows server the path may look similar to:


   Note that the path must include the drive letter on windows servers.

   $core_path = '/usr/www/users/domain/htdocs/weather';

   $core_path = 'c:\inetpub\wwwroot\weather';

Installation : STEP 3 : Setup the hw3.ini.php

Changes to the hw3.ini.php (located in the configs directory)

The hw3.ini.php file follows the standard windows INI file convention. 

  1. The URL to the HAMweather HTML directory (ALL Platforms)

    Here you will set the URL relative (does not include the "http://www.yourdomain.com")  or full (includes the "http://www.yourdomain.com") to the directory containing the HW3 "images" directory. NOTE: During a normal installation this setting should not need to be changed. It only needs to be changed if you install the hw3.php in a different directory that the core directory structure.

    In the hw3.ini.php find the "[Paths]" section.  (around line 3). With-in this section you should see the setting for "html_side_url" (around line 12) it should currently look like:


    Remember you only need to change this line if you install the hw3.php into a different directory structure. 

    Change it to match the URL to the HAMweather HTML directory.


    Database mode. (All Platforms)

    DB Access Type : The type of database you are using will need to be set. HAMweather 3 will support
            1 - Flat file database - This method will work on all servers.

            2 - MySQL - For use mainly on UNIX servers with MySQL access

            3 - MS SQL - For use usually on Windows servers with MS SQL access via ODBC

    If you are using Flat file then in the [Database Access] section you will set "type"
    equal to "Flatfile" (Note: This setting is case sensitive).
    This is the default method and is normally set to this.


    If you are using Flat file mode (most users) then you are done and can move on to
    the next step.

    If you are going to connect to a SQL database then set the type too "SQL":


    Database Type : SQL users will then need to set "database_type" to either "mysql" for a MySQL
    database or to "ODBC" for a MS SQL or MS ACCESSDatabase 


    Database Name : For MySQL this is the name you have created for the database.
    for MS SQL this should be for a SYSTEM DSN (ODBC Connection) which needs
    to be created which points to the MS SQL database

    Host Name : Needed for MySQL and should be the host name of the database server.

    User Name : The username required to access the database.

    Password : Then password used to access the database.

Installation : STEP 4 : Uploading the Files

The Installation requires the uploading of files to your server. The files will normally be uploaded to the html area of your web server. 

Uploading HW3 files

You will need to upload the entire contents (even subdirectories) of the hw3 directory to the HAMweather 3 directory on your server.  This is a directory in your html are of your web server. Often you will create a directory called "weather" and upload the hw3php directory structure to this location.  Make sure you upload the files in ASCII mode, otherwise the scripts may  not run correctly on UNIX servers. Also note that UNIX servers are case sensitive. Beware of this when uploading the directories.

Once you upload the files to the HAMweather 3 PHP directory structure:


Flat File users only


2. Setting permissions of the files and directories

Unix Servers:

Depending on your servers set up, UNIX users will need to set the following permissions:

CHMOD  RWX Directory/Filename
chmod 777 drwxrwxrwx cache directory
chmod 777 drwxrwxrwx logs directory


Windows Servers (NT/2000/XP)

Window servers often will not need permissions set. But if they do you will need to contact the server administrator and have them set permission in both IIS and Windows Explorer to allow write permissions for the  Web server (Normally a user name such as INET_GUEST) to write to the following directories:

Permissions Directory
Read/Write cache directory
Read/Write logs directory


Installation : STEP 5 : Installing the SQL Database (SQL users only)
Installation : STEP 5 : Running the HAMweather 3

If you are using the FlatFile Database (most users) you can skip this step.

MySQL database users:
If you are using a MySQL database then you will need to either install or have your provider install
the sql database file. You can provide them with the "hw3dbmysql.sql" file and they should
be able to import it for you.

If you have telnet/ssh or other command line access to the server you can import the
database by using the following command:


You will need to replace the various items with the same information you put in the
hw3.ini.php file. thus an actual usage of the above line may look similar to:

mysql -hlocalhost -ujondoe -p123abc hw3sql  < hw3dbmysql.sql

MS SQL / MS Access users:

1 - You can either use the file as is for MS Access db usage or you can import the hw3sql_msaccess.mdb to MS SQL using the SQL Server Interprise Manager. If you have not previously performed the following steps 2 and 3 then you will need to perform them now.
2 - Next you will need to create a SYSTEM DSN to either the hw3sql_msaccess.mdb or if you imported to MS SQL to the HW3 MS SQL database you created. If you are using a shared server you may need to contact your provider and have them set up the required SYSTEM DSN.
3 -Next you will need to edit the configs/hw3.ini. In the [Database] Section

Set type to 'SQL'
Set database_type to 'ODBC'
Set database_name to the name of the System DSN you created
database_name=SYSTEMDSN HERE
Set hostname to nothing
Set the username and passwords settings to the corresponding values that were set up in the System DSN created in Step 2. If no username or password was set then leave them blank.
Upload the new hw3.ini.php to your server


Installation : STEP 6 : Running the HAMweather 3

Once installation is complete you should be able to simply browse to the hw3.php on your server.  Just type in the URL to the hw3.php in your web browser. The may URL will look similar to :


If you renamed the hw3.php then you will browse to the HAMweather script via its new name.

If the script does not work correctly visit the HAMweather 3 troubleshooting Guide.  If that does not answer your question then visit the online HAMweather 3 Support Forums.