2

I found this question but somehow, I still don't understand how to include the zend framework.

Zend is located at C:\wamp\zend-library\Zend (this folder contains folders like "barcode", "cache", "db", "EventManager" and so on...)

My php include path is configured like this in php.ini: include_path = ".;C:\wamp\zend-library\Zend" (it is uncommented and the line doesn't start with ;)

output of echo get_include_path() is .;C:\wamp\zend-library\Zend

When trying to run a piece of code where is:

$adapter = new Zend\Db\Adapter\Adapter(array(
    'driver' => 'Mysqli',
    'database' => 'zend_db_example',
    'username' => 'developer',
    'password' => 'developer-password'
 ));

I get only this error: Fatal error: Class 'Zend\Db\Adapter\Adapter' not found in C:\wamp\www\test.php on line 23

I'm using a windows 7 machine, but somehow everywhere everybody is just writing:

Your PHP include_path needs to contain the path to Zend Framework's library

but nobody gives an example how to set up the whole thing. Am I missing some vital information or I just don't understand the whole "simply include it in your path" thing?

4

1 回答 1

2

'Zend' 文件夹是库的一部分,所以你的包含路径应​​该是C:\wamp\zend-library. 您还需要设置自动加载器(ZF 或 Composer)才能使您的代码示例正常工作。

于 2013-09-02T19:13:08.890 回答