• Willkommen im Linux Club - dem deutschsprachigen Supportforum für GNU/Linux. Registriere dich kostenlos, um alle Inhalte zu sehen und Fragen zu stellen.

[PHP] Erlaubte Pfade ändern?

Hallo,


ich wollte grad ein Script aus dem "lib" Ordner von meinem PHP laden.

Dieses Script soll eine einfache Template Engine sein, doch wenn das PHP
Script dieses "lib" laden soll kommt folgender Fehler:

Code:
Warning: main(): open_basedir restriction in effect. File(/usr/lib/php/Smarty/Smarty.class.php) is not within the allowed path(s): (/var/www/vhosts/active-board.de/subdomains/files/httpdocs:/tmp) in /var/www/vhosts/domain.de/subdomains/files/httpdocs/myapp/index.php on line 4

Warning: main(/usr/lib/php/Smarty/Smarty.class.php): failed to open stream: Operation not permitted in /var/www/vhosts/domain.de/subdomains/files/httpdocs/myapp/index.php on line 4

Fatal error: main(): Failed opening required '/usr/lib/php/Smarty/Smarty.class.php' (include_path='.:') in /var/www/vhosts/domain.de/subdomains/files/httpdocs/myapp/index.php on line 4

Nun ist meine Frage recht simpel:
Wie kann ich in PHP diesen Pfad zum erlaubten Pfad hinzufügen?

Danke im vorraus, würde mich über eine Antwort mega freuen.


Viele Grüße aus Hamburg.
 
Ergänze in deiner php.ini-Datei die open_basedir-Direktive, z.B. so:
Code:
open_basedir = /var/www/vhosts/active-board.de/subdomains/files/httpdocs;/usr/lib/php/Smarty/

Danach den Webserver neu starten - fertig.

Gruß
ginka
 
Oben