0

I'm new to Zend. I've download the latest version and followed the instructions to install it but I'm having trouble including the library.

So far I've saved the entire Zend folder to my local host file. Which is the 'sites' folder located in the user folder.

As advised I have altered the php.ini file to include the path of the library as so:

;include_path = ".:/php/includes"
;include_path = ".:/Users/myusername/Sites/ZendFramework20/library"

However when I attempt to run one of the zend demo scripts I get an error:

    Warning: require_once(Zend/Registry.php) [function.require-once]: failed to open stream: No such file or directory in /Users/Sumbop/Sites/ZendFramework20/demos/Zend/Wildfire/public/index.php on line 27

    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Registry.php' (include_path='.:') in /Users/Sumbop/Sites/ZendFramework20/demos/Zend/Wildfire/public/index.php on line 27

I've searched and tried many things to no avail. How do I get this working? Or find a guide?

Thanks

yoozer8
  • 7,361
  • 7
  • 58
  • 93
user999267
  • 13
  • 5
  • did you uncomment the include_path line in your php.ini? In the code sample you supplied it's still commented out. Otherwise these kinds of errors are usually cause by mod_rewrite not being enabled in apache or the stock ZF .htaccess file missing. – RockyFord May 17 '12 at 08:09
  • Hey thanks for the reply. Yes I've uncommented the include_path. But still had no success. I will look into your other suggestions. Thanks – user999267 May 17 '12 at 08:14
  • Seeing as how you are using ZF2 you might go ahead and download the ZF2 skeleton at github https://github.com/zendframework/ZendSkeletonApplication.git – RockyFord May 17 '12 at 08:17

1 Answers1

0

Your include path is wrong.

Fatal error: require_once() [function.require]: Failed opening required 'Zend/Registry.php' (include_path='.:') in /Users/Sumbop/Sites/ZendFramework20/demos/Zend/Wildfire/public/index.php on line 27

You may use next code (somewhere in index.php - best would be first line) to set it.

set_include_path($pathWhereZendFolderIsLocated . PATH_SEPARATOR . get_include_path());
Tomáš Fejfar
  • 11,129
  • 8
  • 54
  • 82