»1. $LJHOME Environment Variable

Be aware that nearly all LiveJournal code depends on the $LJHOME environment variable being set to the top-level directory that LiveJournal is installed at.

Chapter 8: Apache has the necessary directives to make sure the web code always has $LJHOME set, but if you're running LJ maintenance commands from a terminal, you'll need to make sure $LJHOME is set for yourself.

For example, we'll assume that you've installed LiveJournal on an operating system using the Bourne Shell: The easiest way to set $LJHOME is to put the following in your ~/.bash_profile:

LJHOME=/home/lj; export LJHOME

To test that it's set:

$ . ~/.bash_profile
$ echo $LJHOME

If the above was successful, it should print out /home/lj (or whatever the value of $LJHOME may be).

Other shells

If you use another shell interface, you might be able to see what it reads on start-up by looking for the file: ~/.profile. Please refer to the documentation provided with your shell, which can usually be found by typing:

$ help