0

Common Drupal Problems - Solutions Included

Common Drupal Problems - Solutions Included

Whether you are a Drupal newcomer or a seasoned Drupal developer, you're bound to run into one, some, or all of the issues outlined below. Some are obvious, some not so obvious, but we'll show you how to troubleshoot them all regardless.

Some of these issues took a while to troubleshoot, so if you use Drupal as much as we do, make sure you bookmark this page for easy reference in the future. There is nothing worse than spending hours on a problem that can be solved within minutes with the right information (we've all been there).

Issue 01

If you’re working on a Drupal 8 site and you get the message "The provided host name is not valid for this server," you’re not alone. This is a result of a feature added to Drupal 8 to protect against HTTP Host Header attacks.

To fix, set the $settings['trusted_host_patterns'] variable in your settings file. If you are running from one hostname, like www.mysite.com, you’d set it like so: $settings['trusted_host_patterns'] = array( '^www\.mysite\.com$', );

Issue 02

Configuration management in Drupal 8 is great! But you might run into one thing thing that bugs you - for example, if you override a configuration value within settings.php there is no indication in the UI that the values were actually overridden. This is a complete 180 from Drupal 7, which displayed overridden values within the UI. Right now, there is no official solution to this problem, unfortunately, but here are two things you can do:

  • This issue on drupal.org has an actively worked on patch that you can use: https://www.drupal.org/node/2408549
  • The Configuration Update Manager contrib module can give you this info.

Issue 03

Generally, when you’re developing, you don’t want your CSS and JS cached, so that you can debug it. An easy way to make sure caching is turned off is to put these lines in your settings file:

/**
 * Disable CSS and JS aggregation.
 */
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;

Issue 04

MAMP is a fantastic local development tool, but it can sometimes be tricky to set up with Drupal and Drush. Are you getting an error similar to this when using Drush, but the site works fine?

exception 'PDOException' with message 'SQLSTATE[HY000] [2002] No such file or directory' in core/lib/Drupal/Core/Database/Driver/mysql/Connection.php:146

There’s an easy fix. Add the following to your database credentials within your settings.*.php file:

'host' => '127.0.0.1',
'unix_socket' => '/Applications/MAMP/tmp/mysql/mysql.sock',

Issue 05

A lot can go wrong if your files and directories are not properly secured. The extended documentation can be found here.

  • sites/default/files: This directory should have the permissions rwxrwx--- or 770
  • You can use the File Permissions module to correctly set up your file permissions, especially if you are seeing errors about your sites/default/files and sites/default/private directories being incorrectly set up.

Issue 06

You’re setting up a new Drupal installation, or doing something new in an existing one, and boom, a white screen. What do you do? There are a handful of options for debugging. Here are a few to get you started:

  • Check your error logs! Look at your Drupal, PHP, and Apache logs.
  • Make sure you have error reporting on. Follow these directions to turn it on and in many cases, get the errors printed on the WSOD: https://drupal.stackexchange.com/a/54241
  • Here’s a debugging tactic to tell you which module may be hanging up your site and causing the issue: https://drupal.stackexchange.com/a/105194
  • Increase your PHP memory limit !

Issue 07

A lot can go wrong if your files and directories are not properly secured. The extended documentation can be found here.

  • sites/default/files: This directory should have the permissions rwxrwx--- or 770
  • You can use the File Permissions module to correctly set up your file permissions, especially if you are seeing errors about your sites/default/files and sites/default/private directories being incorrectly set up.

Issue 08

You’re setting up a new Drupal installation, or doing something new in an existing one, and boom, a white screen. What do you do? There are a handful of options for debugging. Here are a few to get you started:

  • Check your error logs! Look at your Drupal, PHP, and Apache logs.
  • Make sure you have error reporting on. Follow these directions to turn it on and in many cases, get the errors printed on the WSOD: https://drupal.stackexchange.com/a/54241
  • Here’s a debugging tactic to tell you which module may be hanging up your site and causing the issue: https://drupal.stackexchange.com/a/105194
  • Increase your PHP memory limit !

To be continued...

Comments

robbiepique22

we are being taught about the new advancements of CMS these day. Drupal has really revolutionalize the value and management of content management. Through which we have produced the best possible products. We are developing a new site like back to school promo codes which is giving high value discounted rates.

louisedazzle15

Looking back we have used teamwork to provide cutting edge, custom solutions. We are currently pioneers for Drupal 8 builds because of experience researching Drupal 8 processes and the hours we have spent testing various solutions. In any case, its been justified, despite all the trouble to guarantee we comprehend and I Need an Essay can apply all the new usefulness of this improved form of Drupal.

elizabethdavid530

Looking back, we have used teamwork to provide cutting-edge, customized solutions. We are currently a pioneer in the construction of drupal 8, because of the experience of studying the drupal 8 process and the time we spent testing various solutions and do my paper for me. In any case, it is reasonable, despite all the trouble, to ensure that we understand

JuliaReynolds

These drupal problems are occurring with everyone who is doing the essay service reviews right now. You might think that these problems will go away by themselves, but it's not happening, and that's a worrying thought.

arkr17997
  • Hello guys you have to cinnect the best update for easily access the commend for computer sound not working see the prolem i must be like to share this information and save to all setting for batter working thanks.
rick.09graham

Well these were the similar issues being faced by me nevr seen such progressive thoughts to be shown in great manner never I have been admitted to this point I have gone through most vital sort of information which has be grown along with more admiring information, do my coursework have led me here to this point here.

johnbillhammer21

Loving your content. There was absolutely perfection from the beginning till the end. Because of your contents, internet is my second home. Keep this good work going on for ever.Loving your content. There was absolutely perfection from the beginning till the end. Because of your contents, internet is my second home. Keep this good work going on for ever. How To Extra Money

offpageseo69

I want you to thank for your time of this wonderful read!!! I definately enjoy every little bit of it and I have you bookmarked to check out new stuff of your blog a must read blog! Cocoa

offpageseo69

This is a splendid website! I"m extremely content with the remarks!. Seaweed

offpageseo69

Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return. Prunes

offpageseo69

I have checked this link this is really important for the people to get benefit from. Plum

offpageseo69

This is a splendid website! I"m extremely content with the remarks!. Back Pain

offpageseo69

Well, this got me thinking what other workouts are good for those of us who find ourselves on the road or have limited equipment options. Molasses

offpageseo69

Hi there, I found your blog via Google while searching for such kinda informative post and your post looks very interesting for me Aging Muscles

offpageseo69

Excellent effort to make this blog more wonderful and attractive. Nutmeg

topcelebsjackets45

I am cheerful that you simply shared this valuable in succession with us and a designer needs to do is take after a particular naming tradition, execute a particular snare, and the code gets auto-found and brought to the proper spot. Topcelebs Jackets

kettysmith.00970

Going through a review of websites will give you much insight about it which you can’t know by simply visiting it. Our expert Assignment help Reviews go through many websites each month to select only the best. This makes students aware of websites offering best Assignments.