Seite 1 von 1

CronJobs und savemode

Verfasst: Fr 7. Dez 2007, 12:40
von Oldperl
Steuere ich die Cronjobs auf einem Server mit PHP5 und safemode ON direkt per crontab und lynx kommte folgende Fehlermeldung:
Warning: file_exists(): open_basedir restriction in effect. File(/LC_MESSAGES/contenido.po) is not within the allowed path(s): (/srv/www/webxxx/html/:/srv/www/webxxx/phptmp/:/srv/www/webxxx/files/:/srv/www/webxxx/atd/) in /srv/www/webxxx/html/contenido/includes/functions.i18n.php on line 98 Warning: file_exists(): open_basedir
Abhilfe schafft folgende Ergänzung in den cronfiles in contenido/cronjobs, hier Beispielhaft an der contenido/cronjobs/move_articles.php gezeigt.

Orig. Version in Contenido 4.6.15

Code: Alles auswählen

<?php

/*****************************************
* File      :   $RCSfile: move_articles.php,v $
* Project   :   Contenido
* Descr     :   Cron Job to implement the move article feature
*
* Author    :   Timo A. Hummel
*
* Created   :   26.05.2003
* Modified  :   $Date: 2006/04/28 09:20:55 $
*
* © four for business AG, www.4fb.de
*
* $Id: move_articles.php,v 1.10 2006/04/28 09:20:55 timo.hummel Exp $
******************************************/

include_once ('../includes/startup.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_sql.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.general.php');
include_once ('../includes/functions.con.php');

if ($_SERVER["PHP_SELF"] == "" || function_exists("runJob"))
{
	$db = new DB_Contenido;
	conFlagOnOffline();
	conMoveArticles();
}


?>
Geänderte Version

Code: Alles auswählen

<?php

/*****************************************
* File      :   $RCSfile: move_articles.php,v $
* Project   :   Contenido
* Descr     :   Cron Job to implement the move article feature
*
* Author    :   Timo A. Hummel
*
* Created   :   26.05.2003
* Modified  :   $Date: 2006/04/28 09:20:55 $
*
* © four for business AG, www.4fb.de
*
* $Id: move_articles.php,v 1.10 2006/04/28 09:20:55 timo.hummel Exp $
******************************************/

include_once ('../includes/startup.php');

// safemode bug by oldperl, see forum http://contenido.org/forum
page_open(array('sess' => 'Contenido_Session'));
i18nInit($cfg["path"]["contenido"].$cfg["path"]["locale"], $belang);
page_close();

include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.template.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_sql.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php');
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'functions.general.php');
include_once ('../includes/functions.con.php');

if ($_SERVER["PHP_SELF"] == "" || function_exists("runJob"))
{
	$db = new DB_Contenido;
	conFlagOnOffline();
	conMoveArticles();
}


?>
Getestet in Version 4.6.15.

Serverumgebung:
  • Apache2
  • PHP5.2.4
  • SafeMode ON
Der Fehler zeigt sich auch bei direktem Aufruf der Dateien über den Browser. Könnte mal bitte jemand mit ner ähnlichen Serverumgebung das für die 4.8.23 testen?

Gruß aus Franken

Ortwin

Verfasst: Fr 7. Dez 2007, 13:06
von emergence
hmm... nein ausprobieren kann ich das nicht

versuch folgendes

Code: Alles auswählen

include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.user.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.xml.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.navigation.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.template.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.backend.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.table.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.notification.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.area.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.layout.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.client.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.cat.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["classes"] . 'class.treeitem.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_sql.inc.php'); 
include_once ($cfg['path']['contenido'].$cfg["path"]["includes"] . 'cfg_language_de.inc.php'); 
einfach entfernen...

in dem cronjobs steht sowieso zuviel zeugs das nicht gebraucht wird...