首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Drupal 8索引问题

Drupal 8索引问题
EN

Stack Overflow用户
提问于 2017-02-13 00:42:43
回答 2查看 789关注 0票数 0

我在我的本地主机中使用Drupal8,当转到我的索引页面时,以下代码出现在我的浏览器中:

代码语言:javascript
复制
    <?php

/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt files in the "core" directory.
 */

use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;

$autoloader = require_once 'autoload.php';

$kernel = new DrupalKernel('prod', $autoloader);

$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();

$kernel->terminate($request, $response);

我试图寻找答案,但直到现在都没有成功。

EN

回答 2

Stack Overflow用户

发布于 2017-02-16 00:59:28

看起来您的服务器没有正确配置,所以这并不是Drupal特有的问题。看这里:PHP code is not being executed, instead code shows on the page

票数 0
EN

Stack Overflow用户

发布于 2017-08-30 14:18:03

这不是Drupal错误。您的本地服务器未配置为处理PHP页面。您可以按照以下步骤来解决您的问题。

代码语言:javascript
复制
The correct AddType for php is application/x-httpd-php

AddType  application/x-httpd-php         .php
AddType  application/x-httpd-php-source  .phps
Also make sure your php module is loaded

LoadModule php5_module        modules/mod_php55.so

当你在配置apache的时候,试着在另一个浏览器上查看页面--我曾经有过这样的经历,那就是chrome顽固地缓存结果,它会一直下载源代码,而在另一个浏览器里,这是很好的。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42190302

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档