---
title: Other Things Can Bite
teaser: |
  Environment variables don't take effect for Apache on Windows unless you
  restart the computer.
tags: apache
author: Chad Pytel
published_on: 2006-01-30
---

I was having a lot of problems with getting ps2pdf working from a <abbr
title="Common Gateway Interface">CGI</abbr> Perl program running under Apache on
Windows at a client's site. If you've been [paying attention] you might ask "Why
are you running Apache on Windows and Perl?".  That'd be a good question. The
answer is because this stuff was written before we made that switch, and also
necessity and compromise… definitely a topic for a future post.

[paying attention]: https://web.archive.org/web/20070222024751/http://www.thoughtbot.com/news/2005/11/rubyonrails

Anyway, ps2pdf would work from the commandline, but from the Perl script the
batch file that ps2pdf calls (ps2pdfxx) was not being found. Despite my Google
kung-fu, it took me a while to find [what looked like the solution][solution].

[solution]: https://web.archive.org/web/20061231004004/http://www.talkaboutcomputing.com/group/comp.text.pdf/messages/76870.html

Excited, I did what it said, but it still didn't work! After trying everything
else I could think of, I tried the old trick for Windows – rebooting… Turns out,
environment variables don't take effect for Apache on Windows unless you restart
the computer, even restarting the Apache service doesn't work.

I figure I better post it here for posterity, although hopefully you're not
actively deploying code running under Apache on Windows.
