title: Absolute File Path
body: <p>This problem is still not solved</p>
  
  <p>A video PHP tutorial I am following is building a file called initialize.php in which it is using the PHP pre-defined constant Directory_Separator and then defining a site_root.  The site_root is the <em>absolute file path (not the webserver path)  for PHP to locate the files it needs</em>. He gave us the following code</p>
  
  <pre><code>defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
  
      defined('SITE_ROOT') ? null :
      define ('SITE_ROOT', DS.'Users'.DS.'kevin'.DS.'Sites'.DS.'photo_gallery');
  </code></pre>
  
  <p>I am assuming the file path on his computer is root/users/kevin/sites/photogallery</p>
  
  <p>I am not building the site on my computer, but rather directly online. I don't know what file path to insert instead. </p>
  
  <p>As he emphasized that it's not the webserver path, but rather the file system path, what do I put instead. Just the domain name like this. </p>
  
  <pre><code>define('SITE_ROOT', DS. 'www.example.com');
  </code></pre>
  
  <p>He doesn't want the webserver path but the files are located online? so I don't get it.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>The video tutorial used the following code</p>
  
  <pre><code>defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
  
  defined('SITE_ROOT') ? null :
  define ('SITE_ROOT', DS.'Users'.DS.'kevin'.DS.'Sites'.DS.'photo_gallery');
  defined('LIB_PATH') ? null : define('LIB_PATH',SITE_ROOT.DS.'includes');
  </code></pre>
  
  <p>I used this code: </p>
  
  <pre><code>defined('DS') ? null : define('DS', DIRECTORY_SEPARATOR);
  
  defined('SITE_ROOT')? null: define('SITE_ROOT', realpath(dirname(__FILE__)));
  defined('LIB_PATH') ? null : define('LIB_PATH',SITE_ROOT.DS.'includes');
  </code></pre>
  
  <p>I got this error message</p>
  
  <blockquote>
    <p>require_once(/hsphere/local/home/c263430/quoralist.com/includes/includes/config.php):
    failed to open stream: No such file or
    directory in
    /hsphere/local/home/c263430/quoralist.com/includes/initialize.php
    on line 11 Fatal error:
    require_once(): Failed opening
    required
    '/hsphere/local/home/c263430/quoralist.com/includes/includes/config.php'
    (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/')
    in
    /hsphere/local/home/c263430/quoralist.com/includes/initialize.php
    on line 11</p>
  </blockquote>
  
  <p>UPDATE
  using the 3 edits below by experimentX, as well as the following</p>
  
  <pre><code>define('SITE_ROOT', DS.'hsphere'.DS.'local'.DS.'home'.DS.'c263430'.DS.'quoralist.com');
  </code></pre>
  
  <p>I always got the error message</p>
  
  <blockquote>
    <p>Warning:
    require_once(LIB_PATH/config.php):
    failed to open stream: No such file or
    directory in
    /hsphere/local/home/c263430/quoralist.com/includes/initialize.php
    on line 11 Fatal error:
    require_once(): Failed opening
    required 'LIB_PATH/config.php'
    (include_path='.:/hsphere/shared/apache/libexec/php5ext/php/')
    in
    /hsphere/local/home/c263430/quoralist.com/includes/initialize.php
    on line 11</p>
  </blockquote>
  
  <p>Also, </p>