2017-03-20 9 views
0

Drupal 8이 실행중인 Drupal-server (UBUNTU)가 있습니다. 내 루트 디렉토리에 일부 PHP 파일을 배치하면 브라우저에서 실행할 수 있지만 하위 디렉토리에 동일한 파일을 배치하면 브라우저에서 403 금지 파일 오류가 발생합니다. 이미 권한을 777로 변경했지만 작동하지 않습니다.이 서버의 파일에 액세스 할 수있는 권한이 없습니다.

아무도 도와 줄 수 있습니까?

는 "당신은이 서버에서 myfile을 액세스 할 수있는 권한이 없습니다

금지. 아파치/2.4.18 (우분투) 서버 192.168.51.60 포트 80에서"

+0

모든 부모 DIRS에 액세스 할뿐만 아니라 모든 최대 웹 루트 디렉토리를 허용하십시오. – MilanG

답변

0

I 돈 당신의 서버가 정확히 어떻게 설정되었고 어떤 폴더가 .php 파일인지는 모르지만 기본적으로 Drupal 설치는 아파치 http 서버에서 접근 할 수있는 파일과 폴더를 제한하는 다양한 규칙을 정의하는 .htaccess 파일을 포함합니다. 이 부분에 대한 귀하의 .htaccess 파일을 확인 :

# 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]