it-swarm.com.de

Neue Installation mit HTML-Quelle anstelle von gerendertem HTML

Ich habe gerade drupal 8.8.1 mit Composer installiert).

Beim Starten der Installation wird die HTML-Quelle im Browserfenster angezeigt, anstatt den HTML-Code des Installationsskripts zu rendern. Der folgende Code wird angezeigt:

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8" />
<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="robots" content="noindex, nofollow" />
<link rel="shortcut icon" href="/core/misc/favicon.ico" type="image/vnd.Microsoft.icon" />

    <title>Choose language | Drupal</title>
    <link rel="stylesheet" media="all" href="/core/assets/vendor/normalize-css/normalize.css?0" />
<link rel="stylesheet" media="all" href="/core/misc/normalize-fixes.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/ajax-progress.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/align.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/autocomplete-loading.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/fieldgroup.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/container-inline.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/clearfix.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/details.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/hidden.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/item-list.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/js.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/nowrap.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/position-container.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/progress.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/reset-appearance.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/resize.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/sticky-header.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/tabledrag.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/tablesort.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/components/tree-child.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/system.admin.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/stable/css/system/system.maintenance.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/base/elements.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/base/typography.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/base/print.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/layout/layout.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/action-links.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/breadcrumb.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/button.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/collapse-processed.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/container-inline.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/exposed-filters.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/field.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/form.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/icons.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/inline-form.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/item-list.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/link.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/links.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/menu.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/more-link.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/pager.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/tabledrag.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/tableselect.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/tablesort.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/tabs.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/textarea.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/ui-dialog.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/classy/css/components/messages.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/admin-list.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/content-header.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/container-inline.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/container-inline.module.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/breadcrumb.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/buttons.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/details.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/messages.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/dropbutton.component.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/entity-meta.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/field-ui.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/form.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/help.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/menus-and-lists.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/modules-page.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/node.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/page-title.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/pager.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/panel.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/skip-link.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/tables.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/search-admin-settings.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/tablesort-indicator.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/system-status-report-general-info.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/system-status-report.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/tabs.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/system-status-report-counters.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/system-status-counter.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/components/views-ui.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/theme/colors.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/theme/maintenance-page.css?0" />
<link rel="stylesheet" media="all" href="/core/themes/seven/css/theme/install-page.css?0" />


<!--[if lte IE 8]>
<script src="/core/assets/vendor/html5shiv/html5shiv.min.js?v=3.7.3"></script>
<![endif]-->

  </head>
  <body class="install-page path-frontpage db-offline">
        <a href="#main-content" class="visually-hidden focusable skip-link">
      Skip to main content
    </a>

      <div class="dialog-off-canvas-main-canvas" data-off-canvas-main-canvas>
    <div class="layout-container">

  <header role="banner">
          <h1 class="page-title">
        Drupal
                  <span class="site-version">8.8.1</span>
              </h1>
      </header>

      <aside class="layout-sidebar-first" role="complementary">
      <h2 class="visually-hidden">Installation tasks</h2>
<ol class="task-list">
  <li class="is-active">
    Choose language
    <span class="visually-hidden"> (active)</span>  </li>
  <li>
    Choose profile
      </li>
  <li>
    Verify requirements
      </li>
  <li>
    Set up database
      </li>
  <li>
    Install site
      </li>
  <li>
    Configure site
      </li>
</ol>

    </aside>  
  <main role="main">
          <h2 class="heading-a">Choose language</h2>

    <form class="install-select-language-form" data-drupal-selector="install-select-language-form" action="/core/install.php" method="post" id="install-select-language-form" accept-charset="UTF-8">
  <div class="js-form-item form-item js-form-type-select form-type-select js-form-item-langcode form-item-langcode form-no-label">
      <label for="edit-langcode" class="visually-hidden">Choose language</label>
        <select data-drupal-selector="edit-langcode" id="edit-langcode" name="langcode" class="form-select"><option value="af">Afrikaans</option><option value="ast">Asturianu</option><option value="az">AzÉ™rbaycanca</option><option value="id">Bahasa Indonesia</option><option value="jv">Basa Java</option><option value="bs">Bosanski</option><option value="ca">Català </option><option value="cy">Cymraeg</option><option value="da">Dansk</option><option value="de">Deutsch</option><option value="et">Eesti</option><option value="en" selected="selected">English</option><option value="es">Español</option><option value="eo">Esperanto</option><option value="eu">Euskera</option><option value="fil">Filipino</option><option value="fr">Français</option><option value="fy">Frysk</option><option value="fo">Føroyskt</option><option value="ga">Gaeilge</option><option value="gl">Galego</option><option value="Gd">Gà idhlig</option><option value="hr">Hrvatski</option><option value="it">Italiano</option><option value="sw">Kiswahili</option><option value="ht">Kreyòl ayisyen</option><option value="ku">Kurdî</option><option value="lv">LatvieÅ¡u</option><option value="lt">Lietuvių</option><option value="xx-lolspeak">Lolspeak</option><option value="hu">Magyar</option><option value="mg">Malagasy</option><option value="nl">Nederlands</option><option value="nb">Norsk, bokmÃ¥l</option><option value="nn">Norsk, nynorsk</option><option value="oc">Occitan</option><option value="pl">Polski</option><option value="pt-br">Português, Brasil</option><option value="pt-pt">Português, Portugal</option><option value="ro">Română</option><option value="gsw-berne">Schwyzerdütsch</option><option value="sco">Scots</option><option value="sq">Shqip</option><option value="en-x-simple">Simple English</option><option value="sk">SlovenÄina</option><option value="sl">SlovenÅ¡Äina</option><option value="fi">Suomi</option><option value="sv">Svenska</option><option value="se">Sámi</option><option value="vi">Tiếng Việt</option><option value="tr">Türkçe</option><option value="is">Ãslenska</option><option value="cs">ÄŒeÅ¡tina</option><option value="el">Ελληνικά</option><option value="be">БеларуÑкаÑ</option><option value="bg">БългарÑки</option><option value="ky">Кыргызча</option><option value="mk">МакедонÑки</option><option value="ru">РуÑÑкий</option><option value="sr">СрпÑки</option><option value="tyv">Тыва дыл</option><option value="uk">УкраїнÑька</option><option value="mn">монгол</option><option value="kk">Қазақ</option><option value="hy">Õ€Õ¡ÕµÕ¥Ö€Õ¥Õ¶</option><option value="he">עברית</option><option value="ug">ئۇيغۇرچە</option><option value="ur">اردو</option><option value="ar">العربية</option><option value="ms">بهاس ملايو</option><option value="fa">Ùارسی</option><option value="ne">नेपाली</option><option value="mr">मराठी</option><option value="hi">हिनà¥à¤¦à¥€</option><option value="bn">বাংলা</option><option value="pa">ਪੰਜਾਬੀ</option><option value="gu">ગà«àªœàª°àª¾àª¤à«€</option><option value="ta">தமிழà¯</option><option value="ta-lk">தமிழà¯, இலஙà¯à®•à¯ˆ</option><option value="te">తెలà±à°—à±</option><option value="kn">ಕನà³à²¨à²¡</option><option value="ml">മലയാളം</option><option value="si">සිංහල</option><option value="th">ภาษาไทย</option><option value="lo">ພາສາລາວ</option><option value="bo">བོད་སà¾à½‘་</option><option value="dz">རྫོང་à½</option><option value="my">ဗမာစကား</option><option value="ka">ქáƒáƒ თული ენáƒ</option><option value="am">አማርኛ</option><option value="km">ភាសាážáŸ’មែរ</option><option value="ja">日本語</option><option value="zh-hans">简体中文</option><option value="zh-hant">ç¹é«”中文</option><option value="ko">한국어</option></select>
        </div>
<div data-drupal-states="{&quot;invisible&quot;:{&quot;select[name=\u0022langcode\u0022]&quot;:{&quot;value&quot;:&quot;en&quot;}}}" id="edit-help" class="js-form-item form-item js-form-type-item form-type-item js-form-item-help form-item-help form-no-label">
        <p>Translations will be downloaded from the <a href="http://localize.drupal.org">Drupal Translation website</a>. If you do not want this, select <a href="https://actionfund.nfb.org/core/install.php?langcode=en">English</a>.</p>
        </div>
<input autocomplete="off" data-drupal-selector="form-i-o33hif7d1m-uxztfnjrb8op-dmeqk-qza61jsd-mm" type="hidden" name="form_build_id" value="form-i_o33hif7D1m_uxztfNjRB8op-DMeqK-qZA61Jsd-mM" />
<input data-drupal-selector="edit-install-select-language-form" type="hidden" name="form_id" value="install_select_language_form" />
<div data-drupal-selector="edit-actions" class="form-actions js-form-wrapper form-wrapper" id="edit-actions"><input data-drupal-selector="edit-submit" type="submit" id="edit-submit" name="op" value="Save and continue" class="button button--primary js-form-submit form-submit" />
</div>

</form>

  </main>



</div>
  </div>


    <script type="application/json" data-drupal-selector="drupal-settings-json">{"path":{"baseUrl":"\/core\/install.php\/","scriptPath":null,"pathPrefix":"","currentPath":"","currentPathIsAdmin":false,"isFront":false,"currentLanguage":"en","currentQuery":{"rewrite":"ok"}},"pluralDelimiter":"\u0003","suppressDeprecationErrors":true,"ajaxTrustedUrl":{"form_action_p_pvdeGsVG5zNF_XLGPTvYSKCf43t8qZYSwcfZl2uzM":true}}</script>
<script src="/core/assets/vendor/jquery/jquery.min.js?v=3.4.1"></script>
<script src="/core/assets/vendor/jquery-once/jquery.once.min.js?v=2.2.0"></script>
<script src="/core/misc/drupalSettingsLoader.js?v=8.8.1"></script>
<script src="/core/misc/drupal.js?v=8.8.1"></script>
<script src="/core/misc/drupal.init.js?v=8.8.1"></script>
<script src="/core/misc/states.js?v=8.8.1"></script>
<script src="/core/themes/seven/js/mobile.install.js?v=8.8.1"></script>

  </body>
</html>

Ich zu Recht habe angenommen, dass der Server keinen Content-Type-Header sendet. Ich öffne ../core/install.php und füge hinzu:

header("Content-Type: text/html");

zu install.php und alles beginnt wie erwartet zu arbeiten.

Ist dies ein Fehler in dieser Version von Drupal Setup) oder fehlt mir etwas im Setup dieses Servers? Keine große Sache, aber ich möchte die Dinge richtig beheben.

Folgendes sendet der Server (einschließlich relevanter Informationen zur Umgebung)

Cache-Control: must-revalidate, no-cache, private
Connection: close
Content-Type: text/html;charset=UTF-8
Date: Fri, 27 Dec 2019 16:17:01 GMT
ETag: "1577463421"
Expires: Sun, 19 Nov 1978 05:00:00 GMT
Last-Modified: Fri, 27 Dec 2019 16:17:01 +0000
Server: Apache/2.4.6 (Red Hat Enterprise Linux) OpenSSL/1.0.2k-fips PHP/7.1.27
X-Content-Type-Options: nosniff
X-Powered-By: PHP/7.1.27
2
Neil Davis

Durch Hinzufügen von Folgendes zu .htaccess in ../web wurde das Problem behoben:

<IfModule mod_headers.c>
  <Files ~ "\.(php)$">
    Header set Content-Type "text/html; charset=utf-8"
  </Files>
</IfModule>

Solange Sie explizit Content-Type-Header festlegen, wenn Ihr PHP Dateien ausgibt (wie .pdf, .csv usw.), die Sie sowieso tun sollten, wird dies Ihren Code nicht beschädigen.

0
Neil Davis

Es sieht so aus, als würden Sie den Apache-Webserver unter Red Hat verwenden. Der Rat zu Korrektur sauberer URLs auf Drupal 8 wird dieses Problem wahrscheinlich lösen.

Überprüfen Sie zunächst, ob sich in Ihrem Dokumentstamm eine .htaccess - Datei befindet.

Danach gibt es zwei Lösungen, um diese Regeln zu befolgen.

Eine Lösung besteht darin, Apache zu ermöglichen, die .htaccess - Regeln zu befolgen, die Drupal bietet). Zitat aus diesem Artikel:

In Ihrer Apache-Konfigurationsdatei muss die Direktive Allow Override festgelegt sein (dies ermöglicht lokale Überschreibungen von .htaccess auf Ihrer Site):

AllowOverride All
AccessFileName .htaccess

Die andere Lösung besteht einfach darin, die Konfiguration aus dem .htaccess in die Konfiguration Ihres Webservers zu kopieren.

Stellen Sie sicher, dass Sie den Apache-Server nach dem Ändern der Konfiguration neu starten. In diesem Dokument gibt es noch viele weitere Ratschläge, die es wert sind, gelesen zu werden.

2
greggles