Ar Script Install

Ar Script Install
Install this autoresponder on cPanel hosting. Very EASY if you can follow these instructions.

Installing this app is pretty straight forward. As with any php program that needs database access you first need to set up your database. You can use a previously existing DB if you want, but only 1 copy of Infinite Responder can run per database. Otherwise simply create a new DB, setup a user (user and password) and assign the user to the newly created database. The user needs permission to create, insert, delete, alter and create tables.

After the database is created unpack the Infinite Responder zip file into a directory on your hard drive. Edit config.php and put in the database and user information there. Save the file and upload all of the files to your server, retaining directory structure (there needs to be a templates, images and jscripts folder w/ all of the same subfolders and all of the files in the right subfolders).

Once the files are on the server go to:

And it’ll automatically create the tables you need and populate them with starting data. It should immediately direct you to the config screen where you can set your admin login/pass and change various settings.

At the top of the config screen you’ll see the system location of the install. This will come in handy later when you create your crontab.

Now that the app is installed you need to setup a scheduler to run sendmails.php on a regular basis. If you don’t have access to crontab you can use an 3rd party scheduler service or attach sendmails.php to another page with an include(). Either way, you will need to have this run on a regular basis.

Setting up the crontab:
Crontab is an program that runs the background of most unix servers. All it does it wait for timing instructions and runs things according to the schedule. You can change your scheduled crontabs by running.

crontab -e

From a *nix command line. Also, a lot of hosts offer a crontab utility that gives you access to the crontab from a control panel. Setting up a crontab isn’t simple if you have no unix experience. It’s doubly difficult as the standard editor is VI, a very complex editor that is difficult for beginners to learn.

If you have MySQL and PHP on your server I offer custom installations for only $30.

Once you get into the crontab edit you need to figure out 4 things:
How often do you want it ran?
How do you want to run it?
And where is the file you want to run?
Where do you want output to go?

The first is the most complex. There are 5 time entries to crontab. The last 3 are day settings, and as they’re not often enough for this script we’re going to leave them as just *’s.

This leaves you with:
minutes hours * * *

Minutes is the minutes that you want to run the script on. Hours is the hours.

Lets say you want to run the script at 3:30 every morning:
30 3 * * *

30 minutes at 3 o’clock, every day.

If you only want to run it every hour, do this:
0 1-24 * * *

That’s at the zero minute marker of every hour.

Some people suggest that you run it constantly with:
* * * * *

But in my experience this risks putting a high load on your server if you have a lot users, messages, responders or mails to sort thru. There are 1440 minutes in a day, there is no reason to run it this script 1440 times per day.

Most of the time 10 minute intrevals are enough:
00,10,20,30,40,50 * * * *

That only runs it 144 times per day, which should be enough and not put too much stress on the machine.

If you’ve got a small list or need to check things more often try this:
0,5,10,15,20,25,30,35,40,45,50,55 * * * *

While that’s a big long, it runs the script every 5 minutes. That’s 12 times an hour or 288 times per day.

The second thing you need to know is how you’re going to call the script. You can set up a seperate shell script or CGI wrapper if you need to, but again… if you don’t have a lot of unix experience then doing this would be very time consuming.

You can call the PHP file directly by calling PHP. Depending on how crontab is ran, you may be able to do this by just using:
PHP sendmails.php

But that’s not likely. You can also use lynx if you have it available with:
lynx -dump

That works very well, but it does take some time to load lynx. This isn’t enough to stop you on a small list, but on a big list… or on a server without lynx, you’ll need to do it another way.

The easiest and quickest way is to call PHP by it’s complete path name with:
/usr/local/bin/php sendmails.php

Again, that will depend on where your php is. You can find either lynx or php with the whereis command.

Just type:
whereis php
whereis lynx

From the command line. If you don’t have whereis then ask your admin or tech support.

Where the file you’re running is. This is important because cron won’t run things from the directory you want it to. It needs the full path of the filename in almost every setup. This isn’t a problem. You can get the name of full system path of the install from the first line in the config menu.

It’ll look like:

Then just tack on the name of the script at the end like this:

Simple enough.

Now, where do you want output to go? By default, most systems will send it to your email address. You don’t want this. Why? Because you’ll get an email each and every time it runs. Do you want 300 emails per day telling you that it actually ran your crontab? Yea. I wouldn’t either.

At the end of the filename this:
> /home/user/www/responder/cron.log

And all information will be sent to cron.log Or, if you don’t want to use a file (I wouldn’t, it takes up space) just send it to a special “black hole” file.
> /dev/null

Putting it all together:
Now just add all of it together.

0,5,10,15,20,25,30,35,40,45,50,55 * * * * /usr/local/bin/php /home/user/www/responder/sendmails.php > /dev/null

That runs your script thru PHP every 5 minutes and drops the the output into the great void.

A convenient resouce for this can be found at:

Leave a Reply

Your email address will not be published. Required fields are marked *