Hi again folks.  Thanks to those who helped in trying to find the cause
of my problem this afternoon.

Sorry if the code in this message wraps, but I'm writing this through a
tss connection and damned if I can figure out how to change the wrap
point in outlook :o(

The CMS logged a new error a couple of hours ago which I think might
isolate part of the problem.

The following is the error that was logged:

------
Parse error: parse error, expecting `$' in
/u0/path_to_classes/classes/adodb/adodb.inc.php on line 2713
Unable to include database connection file
------

Line 2713 of adodb.inc.php is:

if ($this->_fetch()) {

The last line about being unable to include the database connection file
is the error which is logged from my script, which (obviously) is thrown
when the adodb.inc.php file can't be included.  That this error is
thrown and the monitor exits gracefully tells me that the monitor is
working correctly.

Below is the code from the file called by my crontab:

#!/usr/local/bin/php
<?php
define('UTIL_PATH','/path/cmsutilDEV/monitor');
define('ARCHIVE_PATH','/path/cmsutilDEV/archive');
define('CMS_PATH','/path/cms-test.unbc.ca/');
define('WWW_PATH','/path/www2-test.unbc.ca/html');
define('WWW_SITE','http://www2-test.unbc.ca/');
define('LOCK_FILE','/path/cmsutilDEV/monitor/cms.monitor.lck');
define('DATE_STAMP',date('Y-m-d H:i:s'));
define('TIME_STAMP',time());

chdir(UTIL_PATH);

require_once UTIL_PATH.'/cms.monitor.inc.php';
$m = new CMS_monitor();
?>

The code in my script up to the point at which the problematic include
file is called is:

<?php
class CMS_monitor
{
  var $conn = null;
  var $db_open = false;
  var $errors = array();

  function CMS_monitor()
  {
   if (file_exists(LOCK_FILE)) {
     $this->CMS_exit_monitor("User lock file exists");
   } else {
     touch(LOCK_FILE) or $this->CMS_exit_monitor('err msg');
     $f = fopen(LOCK_FILE,'w+') or $this->CMS_exit_monitor('err msg');
     fwrite($f,DATE_STAMP) or $this->CMS_exit_monitor('err msg');
     fclose($f) or $this->CMS_exit_monitor('err msg');

     $this->CMS_db_connect() or $this->CMS_exit_monitor('Unable to
connect to database');
  }

// rest of script omitted since it's not getting base the first
conditional.

So all that's happening is require_once is being called, but the parse
error is coming in the required file, to which I have NEVER made
changes.

To me this might seem to indicate that it's something other than a bug
in my code which is causing these errors, especially since if there
really was a problem in the required file, this error would be thrown
every minute.

One other thing worth mentioning is that immediately before this error
occurred there was no content scheduled for publishing.  After this
error occurred the monitor ran twice successfully (again with no content
to be scheduled for publishing), then threw a parse error from one of my
files. 

However the point at which the file is included (shortly after where the
database error is thrown above) occurs before any external data is
passed to a function, so I can't see how that could potentially trigger
the error since the file is simply being included, and no external data
is being used.

So, there is no external data from any source being used before either
of the above errors are thrown.  Not sure if that helps narrow down the
problem or not, but if it does any ideas would be greatly appreciated.

Aside from these errors I'm just about ready to switch our site to the
CMS, and while the errors aren't affecting the overall performance (some
updates are delayed a minute or two by the errors occurring) I have to
say it's making me nervous.

Any help is greatly appreciated.

Cheers and TIA,

Pablo 

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to