Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: PHP_AUTH_USER - nie dziala na PHP4.2.1
Forum PHP.pl > Forum > PHP
wassago
Do niedawna uzywalem php 4.1.1 i nie bylo problemu z logowaniem sie na strone uzywajac PHP_AUTH_USER (wszystko bylo ladnie - okienko gdzie wpisuje haslo i login). no i zainstalowalem PHP4.2.1 (nie radzcie mi abym wrocil do poprzedniej wersji bo GD2 tam nie dziala:) - zreszta w tej tez nie:/)...

Kod
/* PHP_AUTH_USER */



<?php

require("config.php");



$LOGIN = $login;

$PASSWORD = $pass;



function error ($error_message) {

   echo "<body bgcolor=#3A5980><div align=center><b><font size=1px color=#94bedc face=tahoma>".$error_message."</font></b></div><br>";

   exit;

}

if ( (!isset($_SERVER['PHP_AUTH_USER'])) || ! (($_SERVER['PHP_AUTH_USER'] == $LOGIN) && ( $_SERVER['PHP_AUTH_PW'] == "$PASSWORD" )) ) {

   header("WWW-Authenticate: Basic entrer="Form2txt admin"");

   header("HTTP/1.0 401 Unauthorized");

   error("Musisz podac login i hasło!");

}

?>

[...]


kiedy wywoluje ten skrypt, wywala mi taki komunikat:

Kod
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, xxx@xxxxxx.xx and inform them of the time the error occurred, and anything you might have done that may have caused the error.



More information about this error may be available in the server error log.







--------------------------------------------------------------------------------



Apache/1.3.14 Server at localhost Port 80


"...misconfiguration..." - szukalem w konfiguracj (tzn. php.ini) i nie widze tam zadnego bledu... czy ktos wie jak ten problem "zabic";) A moze wystarczy jakis patch albo cos...

ps.

Cytat
manual napisal:
Autoryzacja HTTP nie działa jeśli używasz serwera Microsoft IIS i php w wersji CGI.


qrka bo zwatpilem... chodzi o to, ze PHP_AUTH_USER na Microsoft IIS + php w wersji CGI nie dziala, czy nie dziala na Microsoft IIS i nie dziala na php w wersji CGI?? :/
wassago
sad.gif oj chyba nikt nie wie jak ten problem rozwiazac...
rafkam
Cytat
sad.gif  oj chyba nikt nie wie jak ten problem rozwiazac...


Mialem podobne problemy Z IIS. Przerzucilem sie na apache i ustawilem php jako modul - żadnych problemów i wszystko szybciej hula. GD2 tez dziala.

Apache 1.3.27
php 4.2.3
no i mysql

Jedynie taka mam rade
Pozdr.
Rafkam
uboottd
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, xxx@xxxxxx.xx and inform them of the time the error occurred,
and anything you might have done that may have caused the error.

To jest blad apacha, a nie php-a. Tak jak napisane wiecej informacji mozna znalezc w errror-logu apacza.

W tym konkretnym przypadku najpewniej bedzie tam wpis "Premature end of script .....", co od razu sugeruje php-a jako CGI. A autoryzacja HTTP nie dziala _ani_ na serwerze IIS, _ani_ w przypadku CGI - wtedy to normalny zewnetrzny skrypt nie majacy zadnego dostepu do zmiennych apacza bo i jak ? smile.gif
Cytat
wassago
no ok.. ale co zmienic w cfg apacha aby autoryzacja dzialala?? szukalem jakiejs lini odpowiedzialna za to w cfg ale nic takiego nie znalazlem...
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.