Page 1 of 1

zend problem

Posted: Tue Jan 19, 2010 8:31 am
by eduard77
s the first time when I use Zend and I am a little comfused. I have this code
require_once('Zend/Loader.php'); and this error
Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in D:\wamp\www\phpweb20\htdocs\index.php on line 3
I tought that I didn't do something well and I tried to fine manually the file loader.php but I couldn't find it. There is no such file.
Can anyone tell me what is wrong?

Re: zend problem

Posted: Tue Jan 19, 2010 3:04 pm
by tr0gd0rr
You need to add the Zend directory to your include path. You can do it in php.ini or in code:

Code: Select all

$incl = get_include_path();
// absolute path
set_include_path($incl . PATH_SEPARATOR . '/path/to/Zend/');
// OR path relative to current file
set_include_path($incl . PATH_SEPARATOR . dirname(__FILE__) . '/relative/path/to/Zend');
That is one thing that is kind of annoying about Zend: you have no choice but to update your include path.

Re: zend problem

Posted: Tue Jan 19, 2010 3:12 pm
by eduard77
Thank you for your answer.
I am reather new in php so please be more specific
The zend framwork is in:
c:/program files/wamp/www/webpage/include/ZendFramework-1.9.7
also the path for pear is
c:/program files/wamp/bin/php/pear
Do I need to configure the apache server also?
I included the path in php.ini also but the error is the same
Warning: require_once(Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\webpage\htdocs\index.php on line 3

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.;C:\php5\pear') in C:\wamp\www\webpage\htdocs\index.php on line 3

Re: zend problem

Posted: Tue Jan 19, 2010 5:30 pm
by tr0gd0rr
eduard77 wrote:Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader.php' (include_path='.;C:\php5\pear') in C:\wamp\www\webpage\htdocs\index.php on line 3
Your include_path needs to be ''.;C:\php5\pear;c:/program files/wamp/www/webpage/include/ZendFramework-1.9.7"

You can change the include_path value in php.ini and restart apache or set your include path with set_include_path() before including Zend/Loader.php

Re: zend problem

Posted: Tue Jan 19, 2010 11:33 pm
by eduard77
Thanks but I just found out that mu Zend framework dosen't support Loader.php because they changed with aoutoloader.php.
So that was the problem.
Thanks anyway
It took me 1 day to figure it out but hey " no pain no gain" :banghead:
:banghead: