Sorry for both posts in such a short period of time, but I even though I've
worked around this in my own environment, I thought this post might save
someone else some debug effort.

I'm setting include_path with relative paths in php.ini (and appending to it
in my bootstrap script) and I'm using numerous Zend_* classes all throughout
my code without any trouble, but at one point in my application I hit an
error that indicates Zend_Filter is unable to find Zend_Loader.  This
doesn't make sense because I use Zend_Loader all over the place, including
in my bootstrap script.  After further investigation, it looks like
something is altering my working directory.  I put in an "echo getcwd();" at
the beginning of my app, and another right before I access Zend_Filter (for
the 2nd or 3rd time...), and getcwd()  clearly demonstrates that the working
directory has changed -

IINITIAL CWD: D:\Apache224\htdocs\main
Session open...
Reading session...
GC-ing sessions...
Writing session...
PRE-FILTER CWD: D:\Apache224
*Warning*: Zend_Filter::require_once(Zend/Loader.php) [
function.Zend-Filter-require-once<http://localhost/CK/function.Zend-Filter-require-once>]:
failed to open stream: No such file or directory in *
D:\Apache224\htdocs\CK\library\Zend\Filter.php* on line *88*
*Fatal error*: Zend_Filter::require_once()
[function.require<http://localhost/CK/function.require>]:
Failed opening required 'Zend/Loader.php'
(include_path='.;./application/controllers;./application/models;./application/config;./application/util;./library')



Some random Googling brought me to this page -
http://www.php.net/ob_start
"Some web servers (e.g. Apache) change the working directory of a script
when calling the callback function. You can change it back by e.g.
chdir(dirname($_SERVER['SCRIPT_FILENAME'])) in the callback function."


I'm using Apache, so I did a quick search through the ZF code and I found 12
different occurrences of ob_start.  To narrow it down, I threw echo
statements before each one, and the only one being called is the one in
Zend\Controller\Dispatcher\Standard.php on line 233.  Could this be a
potential defect?  Known issue?  Right now, I'm using absolute paths in my
include_path to work around it.

Thanks,
- Ryan

Reply via email to