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

Looking for help?

Tired of fixing all these tech-problems yourself? We've got an excellent team at Nucleus, a top-class Belgian hosting provider, that can help you. Discover our Managed Hosting, where skilled engineers manage your servers and keep them up-to-date, so you can focus on your core business. We use a variety of Configuration Management Systems such as Puppet to make sure every config is reviewed, unit-tested and guaranteed to be working.

Want to get in touch? Find me as @mattiasgeniar on Twitter or via the contact-page on my blog.

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>