Re: cron job causes debug error
Quote:
As you run, what is written in the crown?
Do you mean what is the Cron command?:
Quote:
php -q /home/xxxx/public_html/tienda/cgi-bin/sitemapxml.php rebuild=yes ping=yes
The sitemapxml
PHP Code:
<?php
/**
* Sitemap XML Feed
*
* @package Sitemap XML Feed
* @copyright Copyright 2005-2010, Andrew Berezin eCommerce-Service.com
* @copyright Portions Copyright 2003-2008 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @link http://www.sitemaps.org/
* @version $Id: sitemapxml.php, v 2.1.1 21.10.2011 11:16:35 AndrewBerezin $
*/
// php -f /home/XXXXXXX/domains/XXXX.ru/public_html/cgi-bin/sitemapxml.php rebuild=yes ping=yes
// /usr/local/bin/php -f /home/XXXXXXX/data/www/XXXX.ru/cgi-bin/sitemapxml.php rebuild=yes ping=yes
if (!is_file(dirname(__FILE__) . '/includes/configure.php')) {
chdir(dirname(__FILE__) . '/../');
} else {
chdir(dirname(__FILE__));
}
if ((!isset($_GET) || sizeof($_GET) == 0) && isset($_SERVER['argc']) && sizeof($_SERVER['argv']) > 1) {
for($i=1,$n=sizeof($_SERVER['argv']); $i<$n; $i++) {
list($key, $val) = explode('=', $_SERVER['argv'][$i]);
$_GET[$key] = $_REQUEST[$key] = $val;
}
}
if (!isset($_SERVER['REQUEST_URI'])) $_SERVER['REQUEST_URI'] = '/' . basename($_SERVER['SCRIPT_NAME']);
if (!isset($_SERVER['HTTP_HOST'])) $_SERVER['HTTP_HOST'] = '';
if (!isset($_SERVER['REMOTE_ADDR'])) $_SERVER['REMOTE_ADDR'] = '127.0.0.1';
if (!isset($_SERVER['HTTP_USER_AGENT'])) $_SERVER['HTTP_USER_AGENT'] = 'Cron /usr/local/bin/php -f ';
$_GET['main_page'] = 'sitemapxml';
function zen_sitemapxml_callback($html) {
$html = str_replace(' ', ' ', $html);
$html = preg_replace('@\s\s+@', ' ', $html);
$html = preg_replace('@<head>(.*)</'.'head>@si', '', $html);
$html = preg_replace('@<script(.*)</'.'script>@si', '', $html);
$html = preg_replace('@<title>(.*)</'.'title>@si', '', $html);
$html = preg_replace('@(</h[1-4]>)@si', "$1\n", $html);
$html = preg_replace('@(<h[1-4]>|<div)@si', "\n$1", $html);
$html = preg_replace('@(<br\s*[/]*>|<p.*>|</p>|</div>|</h\d+>)@si', "$1\n", $html);
$html = preg_replace("@\n\s+@", "\n", $html);
$html = strip_tags($html);
$html = trim($html);
return $html;
}
ob_start('zen_sitemapxml_callback');
include('index.php');
I've asked my hosting for the error log as I can't duplicate this locally.
Re: cron job causes debug error
Quote:
Originally Posted by
torvista
Do you mean what is the Cron command?:
...
The sitemapxml
...
I've asked my hosting for the error log as I can't duplicate this locally.
Everything looks normal.