title: Setting include_path in a shared php.ini file
body: <p>I have 2 Macs whose general configuration I want to keep sync'd. For Apache and PHP, I store the conf files (httpd.conf and php.ini, respectively) in my Dropbox (<code>~/Dropbox/config</code>) and use symlinks to reference the shared from from the expected location.</p>
  
  <p>Similarly, I share a couple of code bases in the same way. The physical files are located in <code>~/Dropbox/Development</code> and linked to from <code>~/Development/</code>. Now I need to share a library of utility classes and I can't figure out how to do that. The problem is that every directory in play sits within my home directory and my username is different on each machine. On one, it's <code>~/rwilkerson</code> and it's <code>~/rob</code> on the other.</p>
  
  <p>How can I get my php.ini to resolve this? In my httpd.conf, I've done so by using environmental variables. For example, in a virtual host config file, I can set my web root to <code>/Users/${SUDO_USER}/path/to/webroot</code>. Since I use sudo to restart Apache (<code>sudo apachectl restart</code>), the environment variable evaluates to the proper username on whichever machine I'm on.</p>
  
  <p>As far as I can tell, I can't use variables in my php.ini in a similar way. I thought that if I simply included both paths in my <code>include_path</code>, PHP would simply ignore the one that doesn't exist on a given machine, but that doesn't appear to be the case. My shared libraries will only be included if the correct path appears <em>before</em> the incorrect path.</p>
  
  <p>I can't find any resource that spells out the nuances of how the <code>include_path</code> directive works, so I can't find any way around this apparent limitation. Anyone have any ideas?</p>
  
  <p><strong>Answer:</strong></p>
  
  <p>I ended up using StasM's solution #1 below. In my httpd.conf file (also shared), I added:</p>
  
  <pre><code>php_value include_path "/opt/local/lib/php:${HOME}/Dropbox/Development/lib/php/classes"
  </code></pre>
  
  <p>Doing that overrode any value in <code>php.ini</code> and worked beautifully.</p>