include() fails when running from terminal but not from the web
<p>I have a PHP script that includes another file in an adjacent directory.</p>

<p>Example code:</p>

<pre><code>include("../lib/file.php");
</code></pre>

<p>The code works fine when you access the page running it from a browser but fails (on the mentioned include() line) if I run it from a terminal or cron.</p>

<p>I get a warning that says "No such file or directory in /path/to/file.php" and as a result the class I try to call from that file doesn't exist, which leads to a fatal error.</p>

<p>What would cause this to work from a browser but fail from terminal.</p>
