‘php_admin_value’ Bug When Overwriting PHP Settings

WARNING: This post was originally published in 2009 and hasn't been updated since.
The tips, techniques and technology explained here may be outdated. If you spot any errors, please let me know in the comments so I can adjust the article. Thanks!

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.

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>

Advertisement

Why ads?

I'm glad you made it to this blogpost. I hope it helps solve your problem. So why then do I show ads on the site? Writing content, testing it and making sure the layout isn't totally b0rked takes time. A lot of time. The ads are a way to pay back a small portion of that time.

And as you know running a site costs (a bit of) money: the domain name, webhosting, time spent writing and updating content, ... So if you like the content of this blog, consider disabling your AdBlocker for this domain. Thanks!

Recent posts

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 this blog.