1

My website is on Pantheon. I am using linux ubuntu 17.10 and LAMP for local development. I use the git clone command and it works. My drupal 8 files are there. Then I export and import the database sql file and the files folder. When I load my website on the local host I get this:

enter image description here

How do I fix this? What am I doing wrong? Am I missing a step?

  • 1
    If the CSS is messed up, re-save the theme settings in the UI. This will re-create the relevant files – Patrick Kenny Nov 18 '17 at 3:24
  • 1
    Also, consider using Lando for Pantheon development instead of a LAMP stack. You can pull your Pantheon site with a single command and you get terminus, drush, and all the relevant tools installed for you. In addition, Lando uses nginx, not apache, so your local dev server will basically be the same as the Pantheon one. github.com/lando/lando – Patrick Kenny Nov 18 '17 at 3:25
1

The issue you're exhibiting is most likely a result of the database reflecting a temp directory (on the Pantheon server) that does not exist or is not writable on your local LAMP environment.

To reset the temp directory for your local development instance, you can:

  1. use drush to set the temp directory (typically /tmp)

  2. navigate to admin/config/media/file-system

If after setting the temp directory and clearing caches, you still exhibit similar behavior, you may want to double check the file owner/group permissions for the public files directory.

See https://www.drupal.org/node/244924 for a how to identify and set permissions, and refer to http://www.drupalden.co.uk/file-folder-permission-settings-drupal-7 which provides a good summary (note- permissions recommended for D7 also apply to D8)

1

If you have "Aggregate CSS files" and "Aggregate JavaScript files" checked in /admin/config/development/performance then the site will be trying to aggregate css and js files below the sites/default/files directory. However that site is not included in the codebase cloned from Pantheon, and you might not have thought to create it, especially if you haven't added files to your site.

Quick Fix: As a quick fix you can uncheck "Aggregate CSS files" and "Aggregate JavaScript files" checked in /admin/config/development/performance, then refresh the page. If that doesn't work then click "Clear all caches" on the same page. However your site will perform better with those 2 aggregation boxes checked. So...

Better Fix: A better solution is to visit your site's Pantheon dashboard, switch to the Git mode, open "Backups", create a new backup, then download the "Files" backup. Extract that downloaded tar.gz file which will give you a directory called something like files_dev. Move that directory into sites/default/ and rename it to files. Check that it has drwxr-xr-x permissions. If not then cd to its parent default directory and issue the command chmod 755 files.

You should also check that your sites/default directory has drwxr-xr-x permissions. If not then open a terminal, cd to your sites directory and issue the command chmod 755 default.

Refresh the site and if necessary clear all caches and the css/js should work again.

For me this fixed a similar issue after importing a site from Pantheon to Lando.

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.