PHP 7.2가 활성화되었지만 내 웹사이트에서 실행되지 않습니다

PHP 7.2가 활성화되었지만 내 웹사이트에서 실행되지 않습니다

방금 Ubuntu 16.04를 다시 설치했는데 여기에 추가하고 싶은 웹사이트가 2개 있습니다. Apache2, PHP 7.2를 설치했습니다.

내 사이트는 다음 경로에 설치되어 있습니다./var/www/html/benshepherd.me

이 파일(benshepherd.me.conf)을 다음 위치에 추가했습니다./etc/apache2/sites-available/

<VirtualHost *:80>
    ServerName      benshepherd.me
    ServerAlias     www.benshepherd.me
    DocumentRoot    "/var/www/html/benshepherd.me"

    CustomLog       /var/log/apache2/benshepherd.me-access.log common
    ErrorLog        /var/log/apache2/benshepherd.me-error.log
    <Directory /var/www/html/benshepherd.me>
        AllowOverride All
    </Directory>
</VirtualHost>

나는 달렸다 a2ensite benshepherd.me, 나는 달렸다a2enmod php7.2

phpinfo()실행 되고 올바르게 작동하는 파일을 만들었습니다 .

그러나 내 웹사이트에 접속하면 코드 줄이 <?php include('includes/styles.php'); ?>실행되지 않고 대신 html 출력으로 나옵니다.

답변1

나는 멍청이다.

index.php와 같은 디렉토리에 index.html 파일이 있습니다.

:|

답변2

Apache 구성(서버 플랫폼에 따라 기본 또는 다양한 하위 포함)에 다음과 같은 줄이 있는지 확인하세요.

AddType application/x-httpd-php .php

관련 정보