title: open_basedir restriction when running script from command line
body: <p>I'm learning how to use the command line by requirement for a recent project. I have a script that will be run during a cronjob, and am testing it by hitting it from the command line using Putty.</p>
  <p>My script runs fine from the browser, but from the command line I get permission errors trying to include files or even check if they exist.</p>
  <p>This only happens from the command line. This is what is in the console (I'm sure the correct script is executing, and all it does for now is check if a required file exists):</p>
  <p>Here is the line in the terminal that executes the command:</p>
  <blockquote>
  <p>secure:~/www/private/cron$ php -f ./update.php</p>
  </blockquote>
  <p>Here is the output:</p>
  <blockquote>
  <p>Warning: file_exists(): open_basedir restriction in effect.
  File(/usr/local/apache/htdocs/example.com/private/modules/real_estate/config/condos.php)
  is not within the allowed path(s):
  (.:/tmp/:/var/tmp/:/usr/local/apache/htdocs/example.com/images/:/home/example/www/images/)
  in /usr/local/apache/htdocs/example.com/private/cron/update.php
  on line 43</p>
  </blockquote>
  <p>I <em>do not</em> get this error running the script in a browser, which is confusing to me - but as I mentioned I am new to using the command line. I've tried every way I can think of to reference the file from <code>update.php</code>, and tried changing the include path, but nothing seems to work. Either I get the permission error or it can't find the file.</p>
  <p>Does anyone know why there is a difference between executing the script in a browser VS the command line, and what I can do to resolve this error? I'm happy to provide more information as requested.</p>
  <hr />
  <h3>More information:</h3>
  <p>This is my CLI output from <code>php --ini</code>:</p>
  <blockquote>
  <p>Configuration File (php.ini) Path: /usr/local/lib<br>
  Loaded Configuration File:         /usr/local/Zend/etc/php.ini<br>
  Scan for additional .ini files in: (none)<br>
  Additional .ini files parsed:      (none)</p>
  </blockquote>
  <p>This is the <code>Loaded Configuration File</code> entry in <code>phpinfo()</code>, from the browser:</p>
  <blockquote>
  <p>/usr/local/Zend/etc/php.ini</p>
  </blockquote>
  <p>So <code>Loaded Configuration File</code> appears to be the same in both environments.</p>