‘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.

Hi! This is a blog where I write down solutions to some of the problems I've faced when working as a sysadmin/dev. I hope you find the information shown here useful to you. Please use the comments on this blog to give feedback about the content!. I'm @mattiasgeniar on Twitter.

Tagged with: , , ,
Posted in php
0 comments on “‘php_admin_value’ Bug When Overwriting PHP Settings
1 Pings/Trackbacks for "‘php_admin_value’ Bug When Overwriting PHP Settings"
  1. [...] more from the original source: ‘php_admin_value’ Bug When Overwriting PHP Settings Related ArticlesBookmarksTags PHP PHP is a computer scripting language. Originally [...]

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>