CronJobs und savemode

Gesperrt
Oldperl
Beiträge: 4316
Registriert: Do 30. Jun 2005, 22:56
Wohnort: Eltmann, Unterfranken, Bayern
Hat sich bedankt: 6 Mal
Danksagung erhalten: 4 Mal
Kontaktdaten:

CronJobs und savemode

Beitrag 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
ConLite 3.0.0-dev, alternatives und stabiles Update von Contenido 4.8.x unter PHP 8.x - Download und Repo auf Gitport.de
phpBO Search Advanced - das Suchwort-Plugin für CONTENIDO 4.9
Mein Entwickler-Blog
emergence
Beiträge: 10653
Registriert: Mo 28. Jul 2003, 12:49
Wohnort: Austria
Kontaktdaten:

Beitrag 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...
*** make your own tools (wishlist :: thx)
Gesperrt