1

I'm sure this is easy if you know how, but I don't.

I've got an ubuntu 10.04 server running PHP5 under apache, all defaults and stuff. The PHP needs some environment variables set. How do I do it?

Do I put them in the apache site config? Do I set them for the nobody user? (Who doesn't have a .profile)

Thanks!

Leopd
  • 1,757
  • 4
  • 24
  • 30

1 Answers1

4

The canonical place to set environment variables for apache in ubuntu is /etc/apache2/envvars. Note that apache would run as the www-data user, not the nobody user. www-data wouldn't have dotfiles in its home anyway.

Additionally, to make the variable available to php, I believe you will need to use PassEnv in the apache configuration

stew
  • 9,388
  • 1
  • 30
  • 43