Archiv für Programmieren

WordPress Mediathek realpath() Fehlermeldung

In gewissen Konstellationen (Webserver mit Ubuntu und PHP 5.2.4) kann es vorkommen, das die PHP Funktion realpath() eine Fehlermeldung ausgibt. Das liegt an dem Hardened-PHP Project’s Suhosin Patch.

Hierzu einfach die functions.php Datei öffnen (liegt im Verzeichnis wp-includes/) und folgende Stelle suchen:

// this is definitive if true but fails if $path does not exist or contains a symbolic link
if ( realpath($path) == $path )
return true;

und durch folgenden Code ersetzen:

// this is definitive if true but fails if $path does not exist or contains a symbolic link
if ( file_exists($path) == $path )
return true;

Und schon ist die Fehlermeldung weg 🙂

Hier noch die Erklärung/Grund

Share