One easy way to manage the display ads on your website is by using phpAdsNew. This first article shows you how to quickly set up phpAdsNew to suit your needs. Read on to find out how this simple tool can help you keep track of those revenue-producing ads and advertisers.
In order to get started with phpAdsNew, you'll need Apache installed with PHP (PHP version 4.0.3 or above), a MySQL database server (MySQL version 3.23 or above) and a copy of the latest release (currently phpAdsNew version 2.0) of the package; you can download this release from http://www.phpadsnew.com.
Note that you may have to edit your "php.ini" PHP configuration file to ensure that "track_vars" and "file_uploads" are turned "On." Furthermore, you may also need to install the following PHP extensions (if they are not already installed): the ZLib extension (if you plan to use Flash-based SWF files) and the FTP extension (if you plan to store the banners on the server’s file system).
Since the database should already exist before you install the application, you’ll need to create one. I recommend that you create a separate database (say "phpads") along with a special MySQL user with the appropriate permissions on this new database.
So, start up a MySQL prompt on your console and execute the following commands.
After confirming that the "phpads" database has been created, we proceed to create a MySQL user with appropriate permissions. Just a little note before you execute the next command: be sure to change the password in the following SQL statement for obvious security reasons.
mysql> GRANT SELECT , INSERT , UPDATE , DELETE , CREATE , DROP , INDEX , ALTER ON `phpads`.* TO "phpadsadmin"@"localhost" IDENTIFIED BY "new_password_here"; Query OK, 0 rows affected (0.02 sec)
This should create a MySQL user with the username "phpadsadmin" with the appropriate permissions to manage our new "phpads" database.
Before you proceed any further, here is a little note on the installation procedure: I plan to integrate phpAdsNew with the website using the "Local mode" invocation mode. The best location to install the software package for this mechanism is under the root folder of your website; mine is located "/www/htdocs/mysite/".
Uncompress the source code archive, as shown below.
$ cd /www/htdocs/mysite/
$ tar -xzvf /tmp/phpAdsNew-2.0.tar.gz
This should create a directory named "phpAdsNew-2.0" with the required files. I recommend that you rename this "phpAdsNew-2.0" folder to "phpads" so that the tool can be accessed using a simpler URL such as http://www.mysite.com/phpads/. The following command should do the needful.
$ mv phpAdsNew-2.0 phpads
One final step before I talk about the browser-based installation screen: file permissions. As is common with most Web-based applications, certain files should be writable by the Web server. In this case, the following command should suffice.