Zend Framework Include Path

For programming and general questions on Zend Framework

Zend Framework Include Path

Postby riaanp on Fri Dec 21, 2012 9:09 am

Good Day,

I see this has been asked a lot in the internet, but no clear way to resolve it. I am hoping someone here can help..

C:\htdocs\liveC:/htdocs
Warning: require_once(library/Zend/Loader.php) [function.require-once]: failed to open stream: No such file or directory in C:\htdocs\live\db_test.php on line 7

Fatal error: require_once() [function.require]: Failed opening required 'library/Zend/Loader.php' (include_path='.;C:\zend\ZendServer\share;C:\zend\ZendServer\share\ZendFramework\library;C:\htdocs') in C:\htdocs\live\db_test.php on line 7


It would appear that the paths are messed up, but I did change the include paths. Jut does not find any php includes.

Sample Code Used:
<?

echo getcwd();
echo $_SERVER['DOCUMENT_ROOT'];

require_once( "library/Zend/Loader.php" );
Zend_Loader::registerAutoload();

$test = new Zend_Config_Ini();

include_once("damin.php")
or die("no");

?>

The damin.php file is in the SAME directory as the test_db.php file (code above), the Loader.php is in a completely different location.

Any suggestions?
riaanp
 
Posts: 1
Joined: Thu Dec 13, 2012 3:15 pm

Re: Zend Framework Include Path

Postby zvika on Fri Dec 21, 2012 1:19 pm

Hi

This is a question on ZF Include Path, so I modified the subject and moved it to ZF forum for better orientation.

You tried to require 'library/Zend/Loader.php', so with your include path, PHP will fail to locate 'C:\zend\ZendServer\share\ZendFramework\library\library\Zend\Loader.php'.

The include path is fine, however you should require 'Zend/Loader.php' (instead of referencing 'library' twice).

Hope this helps,
please report back with any results.
Zvika Dror
Zend Support Team
User avatar
zvika
Zend Global Support
 
Posts: 783
Joined: Sun Dec 14, 2008 9:48 am


Return to Zend Framework

Who is online

Users browsing this forum: Google [Bot], Yahoo [Bot] and 3 guests