errors given failed cron job issues php

I have purchased a ad manager type script and have put so much work in to the site but i cannot get the cron file to execute properly due to errors. The makers of the script arent answering my emails so I am left to find the answer myself im hoping some experts can shine a light on this for me :slight_smile:

I have the cron running once daily as required

the error messages are as follows:

CronStats.php: line 1: ?php: No such file or directory
CronStats.php: line 2: syntax error near unexpected token ;' CronStats.php: line 2: ob_start();’

I have installed the script on two different hosts and get the exact same errors.

any help would be much appreciated

the contents of the cron file are below


<?php ob_start(); ini_set("max_execution_time", 0); error_reporting(0); require_once("db_connection.php"); // hits table fix $ws = mysql_query("select pid from publishersinfo"); while($row = mysql_fetch_assoc($ws)){ $max = mysql_fetch_assoc(mysql_query("SELECT count(distinct ip) as distinct_hits, count(ip) as hits, date from hits where pub_id='$row[pid]' group by date order by hits desc, distinct_hits desc limit 1")); mysql_query("update publishersinfo set hits = '$max[hits]', distinct_hits = '$max[distinct_hits]' where pid = '$row[pid]' "); --- CronStats.zip (1.18 KB) error message.zip (273 Bytes)

How are you implementing this exactly? A cronjob accesses a specific file at a given time. So calling the php file a cron file has me wondering.

[php]30 18 * * * rm /home/someuser/tmp/*[/php]

This is an example that will remove all files in the tmp directory at 1830 everyday.

Sponsor our Newsletter | Privacy Policy | Terms of Service