Horst Nogajski: Pfad-Auflösung & Konfiguration

Beitrag lesen

Hallo Schmuddelkind,  ;)

Habe ich eben gar nicht gesehen, das Du hier 'ne Frage gepostet hast.

Werde mal sehen ob ich was tun kann,

ich habe ein Problem mit dem auflösen von Adressangaben bei einer lokalen Installation von WinNT/Apache1.3.12/php4x.

Seit dem Wechsel von php4.0.6 auf php4.1.2 werden die Pfadangaben anderes aufgelöst. Eine Angabe wie "test/index.php" sollte eigentlich eine absolute Pfadangabe von "http://localhost/test/index.php" haben. Statt dessen liefert realpath() "c:/daten/www/testindex.php".

Verwirrt mich jetzt ein wenig, denn mit realpath() fragt man auch das lokale Dateisystem ab, Du müßtest dann aber "c:\daten\www\testindex.php" als Rückgabe bekommen, da Du auf WinNT arbeitest, und das OS nun mal mit Backslashes arbeitet.

Das entspricht zwar der tatsächlichen Position der Datei auf meiner Festplatte, wird aber z.B. von file_exits() nicht erkannt.

file_exits() = file_exi s ts(), (aber das wirst Du im Script wohl richtig geschrieben haben, denk ich)

Trotzdem gibst Du einem nicht viel Möglichkeiten, ein bischen mehr Quellcode wäre schon besser ...

Es gibt da noch eine Sache, die betrifft aber soweit ich weiß nur die Funktion dirname(). Dort ist im Sprung von PHP 4.0x auf 4.1x eine Änderung in PHP eingeführt worden, die einen eigentlichen Bug dieser Funktion an die sich aber schon alle gewöhnt hatten, korrigiert hat.
So laufen nun alle 'alten Scripte' Gefahr, das Sie auf einem Server mit 4.1x PHP (durch ServerUpdate z.B.) nicht mehr lauffähig sind.

Näheres dazu, inkl. einer kleinen Funktion oder Klasse, die man in diese Scripte einbinden kann damit sie ohne weitere Bearbeitung wieder lauffähig sind gibt's hier:
http://phpclasses.htmlservice.de/browse.html/package/404.html

Name: Fixed functions broken before PHP 4.1.0
Author: Manuel Lemos mlemos@acm.org

Description:
Between versions 4.0.0 and 4.1.0 some PHP functions had its behaviour
broken by PHP developers.

Bug reports on the broken behaviour were made. Despite the broken
functions in question behaved like they did since they were introduced
about 4 years ago, PHP developers that changed the behaviour considered
the bug reports as bogus and did not want provide any means of backwards
compatibility that would make the functions behave as they always did.

This means that PHP programs that rely on the original behaviour of the
broken functions will also be broken starting from PHP version 4.1.0. If
you have PHP programs rely on these functions, either you need to fix your
program eventually banning the use of the broken functions or simply not
upgrade to PHP version 4.1.0 or later.

This class and some wrapper functions are intended to provide original
behaviour of functions that were broken.

So far only two functions were found to be broken: dirname (broken before
PHP 4.0.3) and strtok (broken after PHP 4.0.6). If you know any other
functions that were broken and PHP developers do not want to fix it,
please let me know so we can provide an emulation that provides the
original behaviour to help people that are not aware or do not know how to
implement the original behaviour.

URL: http://phpclasses.htmlservice.de/browse.html/package/404.html

Ich glaube zwar nicht das das Dein Problem ist, aber das zu wissen schadet nicht.

Noch mal schmuddelige Grüße,   ;)
Horst