Advertisement
Guest User

Untitled

a guest
Dec 12th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. SetEnv API_USERNAME 'my_special_username'
  2. SetEnv API_PASSWORD 'my_special_password'
  3.  
  4. echo $_SERVER['API_USERNAME'];
  5. echo $_SERVER['API_PASSWORD'];
  6. // or
  7. echo getenv('API_USERNAME');
  8. echo getenv('API_PASSWORD');
  9.  
  10. [Service]
  11. Environment="API_USERNAME=my_special_username"
  12. Environment="API_PASSWORD=my_special_password"
  13.  
  14. echo getenv('API_USERNAME');
  15. echo getenv('API_PASSWORD');
  16. // $_SERVER does not work when I specify environment variables in systemd
  17. echo $_SERVER['API_USERNAME']; // returns blank
  18. echo $_SERVER['API_PASSWORD']; // returns blank
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement