You are hereServer

Server


MAMP MySQL server doesn't start

If your mysql server won't start in MAMP you should run

sudo killall -9 mysqld

and this will probably make it run again.

WSOD or white screen of death and error reporting

Sometimes you will have a WSOD and nothing to show for. One simple solution to get what is a problem is to insert the following lines into the Drupal's index.php, that should set PHP to report all errors.

<?php
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
?>

and you will probably see that some module is making a problem, so you can fix it or disable it.

Curl on Localhost and WAMP on x64

I was going nuts over how to install CURL on 64 bit windows. I need it for some module and just enabling it from Wamp panel didn't work. So I searched for solutions and there are quite a few combos and solutions offered online but the only thing that worked for me and what was needed is

Navigate to WAMP\bin\php(your version of php)
edit php.ini
Search for curl, uncomment extension=php_curl.dll
Navigate to WAMP\bin\Apache(your version of apache)\bin\
edit php.ini
Search for curl, uncomment extension=php_curl.dll

Drupal Drush Command Cheat Sheet Copy

Everbody likes Drush, why wouldn't you. Anyway I copied cheat sheet from some PDF as this is a drupal dump site and this way I can find it quicker and make also some additions to it.

When available, there is a shorter version of the same command in parentheses.

cache clear (cc) Clear all caches.

cron Run all cron hooks.

disable (dis) Disable one or more modules.

download (dl) Download core Drupal and projects like CCK, Zen, etc.

enable (en) Enable one or more modules.

PM-UPDATE needs the following modules installed/enabled to run: update

Recently I Installed Drush to windows http://drush.ws/drush_windows_installer, scared that it won't work like it should I tried to update some site so I go to local site directory and try pm-update. I get this message

pm-update needs the following modules installed/enabled to run: update. [error]
The drush command 'pm-update' could not be executed.

Reseting passwords in Drupal 7

Reseting drupal password with latest drupal version has become much harder task, before you could just MD5 user table and add new password, now the "salt" is added so it is a bit harder. There are two ways, with mysql and shell access, or with php file. First you can find here

https://drupal.org/node/1023428 - SSH and MySql
https://drupal.org/node/1556488 - PHP file

Drupal Varnish and what to put in .vcl file

Before I talked about some troubleshooting and had some general discussions about caching
http://drupaldump.com/varnish-simple-troubleshooting-defaultvcl
http://drupaldump.com/boost-and-varnish-and-general-tips-and-rants-about...

Now I am going to talk about what to put in your default.vcl file and why.

backend default {
.host = "127.0.0.1";
.port = "8082";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}

Varnish simple troubleshooting for default.vcl

Here is some simple troubleshooting for Varnish

If you want to have simple solution, cache with varnish for all anonymous users and for logged in users you disable varnish use this in your vcl

sub vcl_recv {
#check if there is session cookie from logged in user
if (!req.http.Cookie ~ "SESS|SSESS|NO_CACHE") {
unset req.http.Cookie;
}
# Cache things with these extensions whether we are logged in or not, we don't care
if (req.url ~ "\.(js|css|jpg|jpeg|png|gif|gz|tgz|bz2|tbz|mp3|ogg|swf)$") {
return (lookup);
}
}

Boost and Varnish and general tips and rants about Drupal caching

This topic has always been a big pain in the ass for me. Drupal takes a lot of resources, which means money for hosting, you should at least have VPS to have some decent hosting for drupal, but not to have OOMing and high CPU usage all the time, you should use different caching systems.

Boost

Setting perimissions to files and other Drupal directories or your VPS/Server

If you ever wondered how to setup permission and ownership of files on your drupal server installation, look no further, this article has all the good examples.

https://drupal.org/node/244924