Postcards From My Life

Lint I find in my mind's belly-button.
  • EPK
  • Consulting
  • Resume
  • Nerd Herding
  • Talks
  • How to Plan a Website
  • Zend Framework

Posts Tagged ‘virtualhost’

set_include_path() failing

Thursday, February 14th, 2008

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 [email protected]
    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=

Tags: Apache, Davey Shafik, Kathy Evans, PHP, php_admin_value, php_value, set_include_path, virtualhost
Posted in Apache, PHP | 3 Comments »

 
  • Follow me on twitter!

  • My Latest Book


    Avoiding a Goat Rodeo

  • RSS PHP Podcasts

    • Interview with Elizabeth Naramore
    • SitePoint Podcast #148: All Aboard the Facebook Train
    • MicroPHP vs Complicated PHP – Lately in PHP podcast episode 20
    • SitePoint Podcast #147: The CSS Ninja with Ryan Seddon
    • SitePoint Podcast #146: Patrick Accidentally Installs Chrome
    • Episode 95: Jeff Carouth at ZendCon 2011
    • DPC Radio: Advanced OO Patterns
    • SitePoint Podcast #145: Backbone.js Fundamentals with Addy Osmani
    • SitePoint Podcast #144: Freemium Schmeemium
    • The Debate of Making PHP Faster using a JIT Compiler – Lately in PHP podcast episode 19

  • Me

    • Best web design company
    • Cal Evans Dot Com
    • Cheap Wine Diary
    • Cyrano’s Apprentice
    • Evans Internet Construction Company
    • My Life as a Child
    • PHP Podcasts
    • Sixty Second Tech

  • Tags

    adobe API article book Cal Evans codeworks community conference cw09 developers drupal elizabeth naramore Exim facebook flex freelance fun IBuildings Kathy Evans linkedin Management Marketing microsoft MySQL Nashville phar PHP phparchitect php developers podcast Programming Quickies respect Silly-Con Valley sixty second tech software development speaking startup twitter upgrade video web development wordpress zend zend framework

  • Categories

    • Apache
    • BlogBling
    • Blogging
    • codeworks
    • Entertainment
    • Entrepreneurship
    • Flex
    • Humor
    • JavaScript
    • Long Form
    • Management
    • Marketing
    • Me
    • PHP
    • podcasting
    • Programming
    • SQL
    • Technology
    • Web 2.0
    • wordpress
    • WordPress Plugins
    • writing
    • zend framework


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