2017-03-20 5 views
0

Ich habe einen Drupal-Server (UBUNTU) mit Drupal 8 läuft darauf. Wenn ich eine php-Datei in mein Root-Verzeichnis lege, kann ich sie in meinem Browser ausführen, aber wenn ich die gleiche Datei in ein Unterverzeichnis lege, gibt der Browser einen 403 Verboten-Fehler aus. Ich habe die Berechtigungen bereits auf 777 geändert, aber es funktioniert nicht.Sie sind nicht berechtigt auf Datei auf diesem Server zuzugreifen

Kann mir jemand helfen?

"Verbotene

Sie haben keine Berechtigung Meinedat auf diesem Server. Apache/2.4.18 (Ubuntu) Server auf 192.168.51.60-Port 80 für den Zugriff auf"

+0

Versuchen Sie den Zugriff auf alle übergeordneten Verzeichnisse ermöglicht. – MilanG

Antwort

0

I don Ich weiß nicht, wie genau Ihr Server eingerichtet ist und in welchem ​​Ordner sich die .php-Datei befindet. Die Drupal-Installation enthält standardmäßig die .htaccess-Datei, die verschiedene Regeln definiert, die den Zugriff auf Dateien und Ordner auf einem Apache-HTTP-Server einschränken. Überprüfen Sie Ihre .htaccess-Datei für diesen Abschnitt: auch alle bis zu den Web-root dir

# For security reasons, deny access to other PHP files on public sites. 
# Note: The following URI conditions are not anchored at the start (^), 
# because Drupal may be located in a subdirectory. To further improve 
# security, you can replace '!/' with '!^/'. 
# Allow access to PHP files in /core (like authorize.php or install.php): 
RewriteCond %{REQUEST_URI} !/core/[^/]*\.php$ 
# Allow access to test-specific PHP files: 
RewriteCond %{REQUEST_URI} !/core/modules/system/tests/https?.php 
# Allow access to Statistics module's custom front controller. 
# Copy and adapt this rule to directly execute PHP files in contributed or 
# custom modules or to run another PHP application in the same directory. 
RewriteCond %{REQUEST_URI} !/core/modules/statistics/statistics.php$ 
# Deny access to any other PHP files that do not match the rules above. 
# Specifically, disallow autoload.php from being served directly. 
RewriteRule "^(.+/.*|autoload)\.php($|/)" - [F] 
Verwandte Themen