phpPgAds  Home 

 

 

 

  2.1Installation 

 

Before you can use phpPgAds it needs to be installed properly. We have tried to make the install process as easy as possible. Below you will find all the instructions on how to setup the basic configurations and create the necessary tables inside the database.
If you already have a version of phpPgAds running and want to upgrade to the latest version, please read the Upgrade section of the documentation.

 
  
  2.1.1 Step 1: Copying phpPgAds to the web server  

 


The first step is to extract the files from the downloaded file and copy the files to a directory on the web server. If you are using a Windows system you can use a tool like WinZip to expand the tar.gz or .zip file. On a *nix based web server to can use the tar command to expand the tar.gz file.

tar xvfz phpPgAds_x.tar.gz

Now that the files are placed on the webserver, you need to make sure the webserver can change file config.inc.php which holds the basic configuration settings. If you are using a Windows webserver check the properties of the file and make sure the read-only flag is not set.
If you are using a Linux or Unix webserver you can alter the write permissions with the chmod command from the command prompt:

chmod a+w config.inc.php

If you do not have command line access to your web server then your FTP client should be able to change file permissions.

 

 
  
  2.1.2 Step 2: Running the installer  

 


In step one you have copied the necessary files to the webserver, now that the files are in place, you need to run the installer. To start the installer you need to open a webbrowser and point it to the
directory in which phpPgAds is copied.


Detecting the server configuration

The first thing the installer will do is to determine the capabilities of the webserver. If all the requirements are met the installer will continue with the next step. If phpPgAds fails to determine if it can run properly it display one or more error messages. If you want to know more about these error messages and how to solve them, please read the section Installation Troubleshooting.


Choosing the default language

Once all install conditions are met the installer will ask you for the default language which will be used in phpPgAds.


Setting up the database

phpPgAds uses a PostgreSQL database to store all of its data. On this page you need to provide the basic information on how to contact the database, this includes the hostname of the database server, the username and password to connect to the database and the name of the database itself.

Usually all table names used by phpPgAds have the phpAds_ prefix, so they don't conflict with other tables used by other scripts. Unless you want to use multiple installations of phpPgAds on the same server you can use the default value of the table prefix setting.

If you click 'Proceed' after you have filled in the basic database settings, the installer will check if it can connect to the database and if the supplied user has enough priviliges to create the database structure. A warning will be displayed when any of these checks fails. If you want to know more about these warnings and how to solve them, please read the section Installation Troubleshooting.


Administrator and other settings
The next step would be to setup a username and password for the administrator. You need to enter the password twice to avoid typos. You can use this username and password from now on the log in to the administrator interface.

In order to function correctly phpPgAds needs to know where it is located on the webserver. The installer will try to auto-detect the right location, but if this isn't correct, please supply the right location in the URL prefix field (don't use a trailing slash).


Finishing the automatic installation
After you have supplied all the information above, the installer will try to create the tables inside the database and store the information in the config.inc.php file. If something goes wrong in this last step the installer will display an error message. If you want to know more about these errors, please read the section Installation Troubleshooting.

 

 
  
  2.1.3 Step 3: Configuration  

 


After you have finished running the installer you can log into the administrator interface with the username and password you supplied during the installation. Once you are logged in you can change all the settings and configure phpPgAds to suit your needs. If you want to know more about all the different options, please read chapter 2.3 of the documentation.

After you have properly configured phpPgAds you must not forget to lock the config.inc.php file again, to prevent security problems. If you are using a Windows webserver check the properties of the file and make sure the read-only flag is set. If you are using a Linux or Unix webserver you can alter the write permissions with the chmod command from the command prompt:

chmod a-w config.inc.php

If you do not have command line access to your web server then your FTP client should be able to change file permissions.

 

 
   
  2.1.4 Step 4: Automatic maintenance  

 


The file maintenance.php located in the directory maintenance must be run every day. The file maintenance is responsible for emailing reports to clients and deactivating / activating campaigns.


Scheduling on *nix based servers

If you are using a *nix based servers, such as Linux or BSD you can use the cron daemon to automatically run the maintenance.php file.

You can add the following line to your crontab. The example below is displayed as two lines, but must be added as one line! Instead of fetch, you can also use wget or lynx -dump to call the maintenance file.

59 23 * * * fetch -o - http://www.server.com/phpPgAds/maintenance/maintenance.php
>> /var/log/messages


Scheduling on Windows NT/2000 based servers

If you are using a Microsoft Windows 2000 based server you can use the 'Scheduled Tasks' to automatically run the maintenance file. A Windows NT based server can be configured to run a certain task with the at command.

For more information about scheduled tasks on Windows based servers, please read the documentation provided by Microsoft.To run phpPgAds certain settings are required. phpPgAds requires PHP 4.0.0 or higher


 
   
  2.1.5 Step 5: Congratulations  

 


Congratulations, you have now completed the setup of phpPgAds and can begin adding client, campaigns and banners to your system. If you want to know more about how to add banners to your site please read chapter 3 of the documentation.

If you have any more question about the installation or how to use phpPgAds, please use the forums located at http://www.sourceforge.net/projects/phpPgAds.