Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to have a newline character in an environment variable. I've tried

SetEnv DI_collection_clients_list "client1

which results in

Invalid command 'client2"', perhaps misspelled or defined by a module not included in the server configuration

when restarting Apache.

I've also tried

SetEnv DI_collection_clients_list "client1\nclient2"

which results in the variable of course having a \n instead of a newline.

share|improve this question

The setenv directive is part of mod_env.c which uses the apr function apr_table_setn to store the environment variables in a table. If you look at the source code you'll see that the table just stores the data that is passed to it without any character expansion.

Whatever it is you're trying to do, trying to do it this way is almost certainly wrong.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.