Drupal 安装默认页面未加载 css

Drupal Installation Default Page not loading css

我最近在 Windows 服务器上安装了 Drupal 我没有安装错误。 OPCaching 有一个警告。我也不认为它会影响它,但我使用了 SQLite。

安装后默认页面未加载 CSS。有谁知道为什么会这样或如何解决?

我在另一个网站上找到了解决方案,查看附件中的 link。

"You have enabled CSS compression through admin > Settings > Performance, so the compressed CSS file is creating at sites/default/files/CSS directory and the same file is loading.

If you disable the CSS compression, you can see all the CSS files from the drupal core, contributed modules and theme.

The CSS compressor will combine all the CSS files from the drupal core, contributed modules and themes and create a compressed file in sites/default/files/CSS.

When you are developing, disable the CSS compression, when you deploy on a production server, enable CSS compression."

https://www.quora.com/Why-is-the-Drupal-site-not-loading-CSS

在全新安装中,或者即使由于 install.php 页面本身缺少 CSS 而无法完成安装,请检查错误的 files/folders 权限是否不会阻止Drupal 从读取文件夹“站点”内容。即使您在编辑 settings.php 文件时输入的错误也可能导致此问题。

如果在检查您的权限并清除浏览器中的缓存后问题仍然存在(您可以尝试使用其他浏览器确定),您可以这样做:将您当前的 settings.php 文件重命名为 settings.php.old,复制 sites/default/default.settings.php 到 sites/default/settings.php 并自定义你的数据库连接信息。如果它解决了问题,请检查 settings.php 和 settings.php.old 之间的任何差异,并对旧设置文件应用适当的更正。

我在使用 Drupal 9 时遇到了同样的问题。 为了解决这个问题,我按照以下步骤操作:

  1. 在浏览器中导航至 /admin/config/development/performance。
  2. 带宽优化下,取消选中聚合CSS文件聚合JavaScript文件 个复选框。
  3. 单击保存配置

这样 default/enabled 主题将被加载。 我希望这会有所帮助!