$_SERVER['HTTPS']='on' on reverse proxies - nginx and SSL

When using nginx and SSL and you have a problem that CSS or JS files are using HTTP in their urls and everything else is in HTTPS. The thing you need to do is use this magic


put it in settings.php and also if you have wordpress, do the same, put it in wp-config.php it will do the same and solve the same problem.

Running mysql on mamp localy

If you have more then one mysql installed on your computer and in your path is not proper MYSQL, you should run

?/Applications/MAMP/Library/bin/mysql --host=localhost -uroot -proot

Stdin: is not a tty and other GIT problems when git clone

stdin: is not a tty
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = (unset)
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
remote: Counting objects: 7844, done.

Finding ib_logfile0, ib_logfile1 and ibdata1 on MAMP


You will need this files, probably to delete them on MAMP/MAMP PRO when changing your "innodb_log_file_size" in my.cnf
Right location is very hard to find it is /Library/Application Support/appsolute/MAMP PRO/db/mysql

Git setup with hook for post-receive.

I have setup a simple git workflow.

In one directory on server I made bare repositroy

$ mkdir git-dir && cd git-dir
$ git init --bare

and in other one a folder for my live site

$ mkdir /var/www/www.example.com

then in the git-dir folder edit the post-receive hook

Checking my.cnf settings that are not set

On my WAMP, or MAMP or normal server you may wonder what are the settings for your MySQL that are not set in my.cnf file. There are lot of them and to get quick look at defaults all you need is to run query (you can run it in phpmyadmin for example)

show variables;

and you will have all the variables and their values shown.


If you are running into this error while using drush

Directory ..../drush/cache/default exists, but is not writable. [error] Please check directory permissions.

Run this to solve it

sudo drush version
sudo chown -R $USER ~/.drush

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.