‘php_admin_value’ Bug When Overwriting PHP Settings

If you want to overwrite certain settings for a particular directory, you can either use a .htaccess file or edit the apache config file. One of those changes, could be to alter the include_path for PHP for certain projects. Normally, you'd do this.

<Directory "/var/www/vhosts/xxx/httpdocs/">
        php_admin_value include_path "/var/www/<loc>/:/usr/share/pear/:/tmp/"
</Directory>

You might run into some unexpected results, where the include_path isn't actually changed, and the files you're trying to include aren't being included.

Try changing it to this.

<Directory "/var/www/vhosts/xxx/httpdocs/">
        php_value include_path "/var/www/<loc>/:/usr/share/pear/:/tmp/"
</Directory>

There's currently a known bug (#43677 [resolved]) that causes unexpected results when using the php_admin_value. A quick fix is changing this to php_value. Release 5.2.6 made a permanent fix for this, but not every commercial hoster or commercial controlpanel immediately updates to the latest release. If you see strange behaviour for PEAR packages that aren't being included, despite setting the include_path correctly -- this might be the reason.

The Social Box

You can sign up for more updates via Twitter or Facebook below. On Twitter, I regularly talk about technology or tweet about interesting stories. Topics that don't necessarily make it to this blog. Facebook contains a steady update of blogposts and some more lightweight stories.

The @mattiasrss account has an automated RSS feed of all blogposts that get published.




Write a Comment

Do you care about the markup if your comment? You can use the following HTML tags:

<code>command</code>: command highlighting
<pre>text</pre>: pre-formatted code, can be multi-line (black background, white letters)

example <pre> tag
<blockquote>text</blockquote> quoted text
quoted example


None of this is needed of course, it's all optional!

Comment

*