<p>I can set the PHP include path in the <code>php.ini</code>:</p>

<pre><code>include_path = /path/to/site/includes/
</code></pre>

<p>But then other websites are affected so that is no good.</p>

<p>I can set the PHP include in the start of every file:</p>

<pre><code>$path = '/path/to/site/includes/';
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
</code></pre>

<p>But that seems like bad practice and clutters things up. </p>

<p>So I can make an include of that and then include it into every file:</p>

<pre><code>include 'includes/config.php';
</code></pre>

<p>or</p>

<pre><code>include '../includes/config.php';
</code></pre>

<p>This is what I'm doing right now, but the include path of <code>config.php</code> will change depending on what is including it. </p>

<p>Is there a better way? Does it matter?</p>

If you're using apache as a webserver you can override (if you allow it) settings using
.htaccess
files. See
the PHP manual
for details.
Basically you put a file called
.htaccess
in your website root, which contains some PHP
```
ini
```
values. Provided you configured Apache to allow overrides, this site will use all values in your PHP config, + the values you specify in the
.htaccess
file.
Can be used only with
```
PHP_INI_ALL
```
and
```
PHP_INI_PERDIR
```
type directives
as stated in the page I linked. If you click through to the full listing, you see that the include path is a
```
PHP_INI_ALL
```
directive.