Page 1 of 2

PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 12:57
by recoilmaster
Hi !

Ich bekomm bei meinem Confixx, zwischendurch immer PHP Fehler wie

Code: Select all

Warning: Unknown(): open_basedir restriction in effect. File(/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php) is not within the allowed path(s): (/usr/local/apache2/htdocs/web1/) in Unknown on line 0

Warning: Unknown(/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php): failed to open stream: Operation not permitted in Unknown on line 0

Warning: (null)(): Failed opening '/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0

Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 9
Wie kann ich diese Fehlermeldung weg bekommen ?

Danke

Bye Keule

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 14:39
by arty
Saubere und korrekte Programmierung und Konfiguration von PHP.

bye
arty

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 14:41
by recoilmaster
Habs nicht programmiert und es ist die Standart Konfiguration, die vor der Confixx Installation ohne Fehler lief *_*

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 14:42
by arty
Wenn es die Standardkonfiguration wäre, würde es doch klappen, oder?

bye
arty

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 14:53
by ego
Stell mal include_path auf "." in deiner php.ini oder in den VHost Configs

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 20:53
by recoilmaster
Immer noch

Code: Select all

Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/user/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/user/auth.php on line 9

Ich bin...

Posted: 2004-02-04 21:03
by vevelt
...mir nicht sicher, aber du hast PHP 4.3.4 drauf, oder? Und Apache2?
Soweit ich weiss, gibt es dort momentan Probleme mit einer nicht übergebenen Variable. Mit PHP 4.3.5 soll das behoben sein...

Gruß, Sebastian.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 21:19
by recoilmaster
Hi !

Danke für den Tipp, ich probiers direkt mal aus.

Bye Nils

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-04 23:41
by recoilmaster
Hat nicht gebracht :/

Code: Select all

Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/confixx/html/reseller/auth.php on line 6

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/reseller/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/reseller/auth.php on line 7

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/reseller/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/reseller/auth.php on line 8

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/reseller/auth.php:6) in /usr/local/apache2/htdocs/confixx/html/reseller/auth.php on line 9

open_basedir kontrollieren

Posted: 2004-02-06 19:45
by proportal.de
Hast Du Dir schonmal die Einstellung für's open_basedir angeschaut? Die eigentliche Fehlermeldung auf die man sich konzentrieren sollte ist

Code: Select all

Warning: Unknown(): open_basedir restriction in effect. File(/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php) is not within the allowed path

Warning: Unknown(/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php): failed to open stream: Operation not permitted in Unknown on line 0 

Warning: (null)(): Failed opening '/usr/local/apache2/htdocs/confixx/html/user/allgemein_start.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0 
und nicht die

Code: Select all

... headers already sent ...
Meldungen. Diese sind nur ein Seiteneffekt der durch die eigentlichen o.a. Warnungen entsteht.

Die Meldung besagt, dass die Datei auf die zugegriffen werden soll, nicht im oder unter dem open_basedir liegt. Dies wäre
beispielweise der Fall, wenn das open_basedir in Deinem Fall

Code: Select all

/usr/local/apache2/htdocs/undnocheins/
oder anders

Code: Select all

/www/
lauten würde.

Kontrolliere einfach mal das open_basedir.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-06 20:00
by oxygen
Unter Apache muss jeder Vhost ein open_basedir haben, sonst kommt bekommen plötzlich Vhost die keinen haben, einen von den anderen.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-06 23:02
by recoilmaster

Code: Select all

DocumentRoot /usr/local/apache2/htdocs/confixx/html
steht in der httpd.conf und die Dateien sind auch in keinem Unterverzeichniss.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 12:53
by proportal.de
Hi,

nicht das DocumentRoot. Das DocumentRoot bezeichnet das Rootverzeichnis der Domain,
ist jedoch nicht immer mit dem open_basedir identisch.

Schau mal unter http://de3.php.net/features.safe-mode nach. Dort findest Du Informationen
zum Umgang mit dem open_basedir.

In der vhost solltest Du einen Eintrag ähnlich

Code: Select all

<Directory /vhosts/domain.com/httpdocs/> 
php_admin_value safe_mode 1
php_admin_value open_basedir "/vhosts/domain.com/httpdocs/"
</Directory>
für das Confixx Verzeichnis haben.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 14:36
by recoilmaster
Nach open_base Dir Eintrag leider keine besserung :/

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 17:20
by proportal.de
Wie schaut die Einstellung den momentan aus?
Kannst Du mal den Confixx relevanten Teil posten?

Ist zwar eine dreckige Methode, aber Du könntest die auth.php mal in der ersten Zeile um

Code: Select all

die("open_basedir: '".ini_get("open_basedir")."'");
erweitern, damit würdest Du definitiv wissen, wie das open_basedir
beim Aufruf des Scripts gesetzt ist. Vielleicht ein Anhaltspunkt. Sei jedoch
vorsichtig beim basteln.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 17:28
by recoilmaster
Hi !

Danke für die Hilfe.

Haba ber im PHP Bugreport herausgefunden das es ein bekannter Bug ist.

Einfach

Code: Select all

php_admin_value open_basedir none
In die Virtual Host Sektion von Confixx und es leuft.

Bye Nils

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 17:40
by proportal.de
Gut zu wissen, kannst Du noch die URL vom Bugreport veröffenlichen?

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 17:47
by recoilmaster

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 17:55
by recoilmaster
Hi !

Die Headerfehler sind auch einfach zu deaktivieren.

Einfach inder betreffenden Datei folgendes machen

Code: Select all

#header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");    // Date in the past
#header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
#header("Cache-Control: no-store, no-cache, must-revalidate");  // HTTP/1.1
#header("Pragma: no-cache");                          // HTTP/1.0
jeweils ein # vor die 4 Werte, es sind auch keine Systemrelevanten Befehle, daher besteht kein Risiko.

Bei PHP5 tritt der open_basedir Bug auch auf.

Einfach wie bei PHP 4

Code: Select all

php_admin_value open_basedir none
In die Virtual Host Sektion von Confixx und es leuft.

Dafür hänge ich jetzt an einer anderen Fehlermeldung

Code: Select all

Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php:21) in /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php on line 22
Die Header lassen sich leider nicht mit einem # deaktivieren, da sonst Webmail nicht mehr laüft :)

Code: Select all

if ($webmail_session == "") {
	$id = db_query("insert into webmail_session (pop3, password, lang, timestamp) VALUES ('$PHP_AUTH_USER', '".crypt($PHP_AUTH_PW, mkpasswd(2))."', '$shortlang', '".db_timestamp(time())."')");
	setcookie("webmail_session", db_insert_id($id, 'seq_webmail_session'), 0, "/cgi-bin/webmail/");
	setcookie("webmail_pass", $PHP_AUTH_PW, 0, "/cgi-bin/webmail/");
Betrifft es.

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 19:18
by proportal.de
Das liegt daran, das ein Script bereits vor den header() Kommandos etwas an den Client
geschickt hat. Was steht vor den

Code: Select all

Warning: Cannot modify header  .....
Zeilen?

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-07 19:25
by recoilmaster
Nichts, nur das was ich geposted hab.

Warum der Fehler kommt ist klar :)

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-10 13:10
by recoilmaster
Recoilmaster wrote:
Dafür hänge ich jetzt an einer anderen Fehlermeldung

Code: Select all

Warning: Cannot modify header information - headers already sent in /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php on line 21

Warning: Cannot modify header information - headers already sent by (output started at /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php:21) in /usr/local/apache2/htdocs/confixx/html/poplogin/allgemein_start.php on line 22
Die Header lassen sich leider nicht mit einem # deaktivieren, da sonst Webmail nicht mehr laüft :)

Code: Select all

if ($webmail_session == "") {
	$id = db_query("insert into webmail_session (pop3, password, lang, timestamp) VALUES ('$PHP_AUTH_USER', '".crypt($PHP_AUTH_PW, mkpasswd(2))."', '$shortlang', '".db_timestamp(time())."')");
	setcookie("webmail_session", db_insert_id($id, 'seq_webmail_session'), 0, "/cgi-bin/webmail/");
	setcookie("webmail_pass", $PHP_AUTH_PW, 0, "/cgi-bin/webmail/");
Betrifft es.
Hat einer eine Idee ?

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-10 18:00
by conym18
zeig doch mal das script?

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-10 19:59
by recoilmaster
allgemein_start.php von Confixx 2.0 die betroffene Zeile steh 1 Beitrag höher.

Bye Nils

Re: PHP Fehlermeldung nach Seitenaufbau

Posted: 2004-02-10 21:03
by conym18
hi,

ich kenne es so, das man erst den header (also cookie) führen muß und dann denn rest. (noch vor dem <html>)


conym18