2

I just installed drupal 8.8.1 using Composer.

When starting installation it displays HTML source in browser window instead of rendering the HTML of the installation script. The code below is what is displayed:

<!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>

I rightly assumed that the server isn't sending Content-Type header. I open ../core/install.php and add:

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

to install.php and all starts working as expected.

Is this a bug in this version of Drupal setup or am I missing something in this server's setup? Not a huge deal but I'd like to fix things properly.

Here is what the server is sending out (which includes pertinent info about environment)

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
  • Probably server. But to say with more certainty we need more info. Like how did you install, on what server, with what PHP and so on. – leymannx Dec 27 '19 at 16:15
  • 1
    updated with info about environment – Neil Davis Dec 27 '19 at 16:19
  • Is Drupal's .htaccess in the webroot? – leymannx Dec 27 '19 at 17:16
2

It looks like you are using Apache webserver on Red Hat. The advice on fixing clean urls on Drupal 8 will probably solve this problem.

First, check to confirm there is a .htaccess file in your document root.

After that, there are 2 solutions to get those rules to be followed.

One solution is to enable Apache to follow the .htaccess rules that Drupal provides. Quoting from that article:

You will need to have the Allow Override directive set in your Apache configuration file (this will allow local .htaccess overrides on your site):

AllowOverride All
AccessFileName .htaccess

The other solution is simply to copy the configuration from the .htaccess into your webserver's configuration.

Be sure to restart the apache server after changing the configuration. There are many more bits of advice in this document that are worth reading.

|improve this answer|||||
  • It should be noted that AccessFileName .htaccess Needs to go in the <VIrtualHost> configuration and AllowOverride All goes in the <Directory> config Simply pasting the code in the answer in httpd.conf or in any section will break apache. This solution also doesn't work to solve this problem.... – Neil Davis Jan 7 at 16:11
  • Good point, the excerpt alone is not enough to solve the problem. That document is very long and I pasted one piece of it. All of it is relevant. – greggles Jan 7 at 19:10
0

Adding the following to .htaccess in ../web solved issue:

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

As long as you explicitly set Content-Type headers when your php is outputting files (such as .pdf, .csv etc) which you should be doing anyway, this won't break your code.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.