Postcards From My Life

Lint I find in my mind’s belly-button.
  • Home
  • Consulting
  • Resume
  • Subscribe
  • epk
« Podcasting 101 slides
Happy Valentines Day! »

set_include_path() failing

Dear Reader,

The title of this post will confuse most of you but I chose it on purpose. I hit a wall last night and couldn’t find anything on the web to help me over it.

The Problem

<?PHP
var_dump(set_include_path('./'));

Drop this little piece of code into a file and place it on your web server. What you SHOULD get back is a string describing your old include path. If you get false, you have hit the problem I hit last night. I went so far as to recompile 2 difference versions of Apache thinking (almost correctly) that it was something that had changed in my Apache config files.

The Solution

Like most Apache installs, my development server has a single config file for each domain. (In my case they are all *.dev domains, I don’t host any live domains on my cable modem) In each config file, I set not only Apache settings but some defaults for things like php’s include path for that domain. Here’s an example for my development are for calevans.com

<virtualhost 192.168.0.99:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot /home/calevans.com/public_html
    ServerName www.calevans.dev
    ServerAlias www.calevans.dev calevans.dev
    ErrorLog logs/dummy-host.example.com-error_log
    CustomLog logs/dummy-host.example.com-access_log common
    php_value include_path /usr/local/lib/php:/home/phpinc/:/home/calevans.com/phpinc
</virtualhost>

As you can see, I use php_value to set the default include path. However, for some reason, I had started using php_admin_value to set it and other settings. After 4 long hours of banging my head on this, my friend Davey Shafik popped into #phpwomen (yes, I hang out there…its like taking “Home Economics” in high school, you do it because it’s where all the girls are) and said:

[22:54] Davey: I know what it is ;)
[22:54] Davey: php_admin_value include_path
[22:54] Davey: you have that somewhere
[22:55] Davey: you *cannot* override php_admin_value settings

Son-of-a-gun if he wasn’t right. For some reason I had started using php_admin_value instead of just php_value. php_value can be overridden in your code, however, php_admin_value tells PHP not to allow the value to be overridden.

Why is this important

If you are working with Zend Framework, then this is VERY important. Zend_Loader temporarily modifies the include_path when including things like Controllers. If it can’t do so, your apps will fail in a most spectacular way.

Wife 1.24 (The lovely and talented Kathy) says that now I know how everyone else feels when I walk over and solve problems. (I have a tendency to do that and am usually pretty snarky about it when I do)

Until Next Time,
(l)(k)(bunny)
=C=

[Post to Twitter] 

Related posts

  • tek09 Roundup (2)
  • Forks!=Threads! (0)
  • What I did on my vacation (1)

Tags: Apache, Davey Shafik, Kathy Evans, PHP, php_admin_value, php_value, set_include_path, virtualhost

This entry was posted on Thursday, February 14th, 2008 at 7:42 am and is filed under Apache, PHP. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

3 Responses to “set_include_path() failing”

  1. PHPDeveloper.org Says:
    February 14th, 2008 at 3:11 pm

    Cal Evans’ Blog: set_include_path() failing…

    Cal Evans came up against a problem earlier in his development ……

  2. Jeremy Kendall Says:
    February 18th, 2008 at 8:10 pm

    Hey Cal,

    Nice post. This is the kind of thing that you spend hours on Google and forums trying to find, everyone’s heard about it or fixed it, but no one remembers quite how to fix it or they don’t share all of the steps. Thanks for taking the time to spell it out for us.

    JK

  3. Félix Says:
    February 20th, 2008 at 9:32 am

    I LOVE YOU.

    I clicked your ads to thank you.

  • php|tek 09



    Zend Framework and the CLI

    A Manager's Guide to
    Telecommuting

  • My New Project

  • Sponsors and Ads

  • About Me

    cal_evansThis is my blog. Sometimes it's my deep thoughts, sometimes it's a journal of things I've learned. Every now and then it's my box of shattered dreams. Most of the time though, it's just the place I like to write. Sit with me as I show you some postcards from my life. While you are here, do me a favor and leave a comment.

    If you are looking for my contact information, bio, picture, ASL, check out my EPK.

    My name is Cal Evans and this is my blog.



    Follow me on FriendFeed!

    View Cal Evans's profile on LinkedIn

  • My First Book

  • Tags

    Apache API Apple article C.C. Chapman Cal Evans CIO Magazine Consulting customer service developers devzone dr. dobbs elizabeth naramore facebook FireBug flock fun hiring IBuildings iPod Kathy Evans linkedin love Marketing nerd herding PHP php abstract phparchitect php developers podcast poem respect securephphosting sixty second tech southwest airlines spaz terry chay tivo twitter upgrade valentine video wordpress zend zend framework

  • RSS The Lovely and Talented Kathy’s blog

    • Fushi Copperweld Website
    • Cal Evans’ Blog
    • KathyEvans.biz V2.0

  • RSS Sixty Second Tech

    • UTC
    • FireFox 3
    • The New Mediology on Twitter
    • MobileMe
    • Amazon’s S3
    • Attention, Not SERP!
    • I Want Sandy
    • Pipes!
    • Get Your Head in the Cloud!
    • Rich Internet Applications

  • Categories

    • Apache
    • Apple
    • BlogBling
    • Blogging
    • Consulting
    • Entertainment
    • Entrepreneurship
    • Exim
    • flex
    • hosting
    • Humor
    • JavaScript
    • jobs
    • Long Form
    • Mac
    • Management
    • Marketing
    • Me
    • photography
    • PHP
    • podcasting
    • Programming
    • Quickies
    • RSS
    • Silly-Con Valley
    • SQL
    • Technology
    • twitter
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework

  • RSS PHP Podcasts

    • The ZendCon Sessions Episode 21: PDO: PHP Data Objects
    • The ZendCon Sessions Episode 20: Distribution and Publication With Atom Web Services
    • The ZendCon Sessions Episode 19: Static and Dynamic Analysis at Ning
    • PHP Abstract Podcast Episode 41: Zend Framework 1.8
    • The ZendCon Sessions Episode 18: Of Haystacks and Needles
    • Zend_Db Update and Delete
    • The ZendCon Sessions Episode 17: SQL Query Tuning: The Legend of Drunken Query Master
    • Zend_Db Insert and Read
    • The ZendCon Sessions Episode 16: PECL Picks - Extensions to make your life better
    • Integrating Bits on the Run into Zend

  • Vanity Chart

    English posts that contain "Cal Evans" per day for the last 30 days.
    Technorati Chart
    Get your own chart!

  •  

    February 2008
    M T W T F S S
    « Jan   Mar »
     123
    45678910
    11121314151617
    18192021222324
    2526272829  

  • XBox Gamer Card

  • Blogs of friends

    • Ashley Evans
    • Cory
    • Davey Shafik’s Pixelated Dreams
    • Daytona Twentyfour
    • Fred Leo’s Blog
    • Louis Davidson
    • The Lovely and Talented Kathy

  • Me

    • Best. Webhosting. Ever.
    • Cal Evans Dot Com
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts
    • Sixty Second Tech

  • Archives

    • June 2009
    • May 2009
    • April 2009
    • March 2009
    • February 2009
    • January 2009
    • December 2008
    • November 2008
    • October 2008
    • September 2008
    • June 2008
    • May 2008
    • April 2008
    • March 2008
    • February 2008
    • January 2008
    • December 2007
    • November 2007
    • October 2007
    • September 2007
    • August 2007
    • July 2007
    • June 2007
    • May 2007
    • April 2007
    • March 2007
    • February 2007
    • January 2007
    • December 2006
    • November 2006
    • October 2006
    • September 2006
    • August 2006
    • July 2006
    • June 2006
    • April 2006
    • March 2006
    • February 2006
    • January 2006
    • December 2005
    • November 2005
    • October 2005
    • September 2005
    • August 2005
    • July 2005
    • June 2005

  • Flickr Recent Photos

    The Bike vs. The HillDSCN2058.JPGCute Dutch GraffitiIvo "Joe Cool" JanschDSCN2030.JPGDSCN2029.JPGDSCN2028.JPGDSCN2027.JPGDSCN2026.JPGDSCN2025.JPG

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org


Postcards From My Life is proudly powered by WordPress
Entries (RSS) and Comments (RSS).