0

Problems with require_once 'Zend/Library/Autoloader.php'

PHP Warning:  require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in /var/www/DenisApp/scripts/load.sqlite.php on line 13

PHP Fatal error:  require_once(): Failed opening required 'Zend/Loader/Autoloader.php' (include_path='/var/www/DenisApp/application/../library:.:/usr/share/php:/usr/share/pear') in /var/www/DenisApp/scripts/load.sqlite.php on line 13

I have no idea what to do ! Please help ...

Denis.
  • 1
  • 1
  • Where is the Zend-folder located? In `/var/www/DenisApp/application/../library` ? – Peter van der Wal Mar 22 '14 at 10:55
  • i don't know i can't find it ! – Denis. Mar 22 '14 at 10:57
  • 1
    If you can't find it, how do you expect PHP can. You should tell him where it is by adding it to the include_path (http://php.net/set_include_path). Is this your first Zend-project on that server, or do you have more? – Peter van der Wal Mar 22 '14 at 10:58
  • Is this issue resolved. I believe I have faced the issue once. I think it is the SQLite path that you use in your config loader array that could be the issue. Try with a complete path to see if the error goes away. Then start using the relative paths is a better way of debugging whether its a path or SQLite module loading issue which is actually one of your stack trace I believe. – Gary Jan 01 '16 at 10:13

2 Answers2

0
  1. Download the correct Zend-version that your load.sqlite.php expects (can't find much about it, but it looks like the 1.x-range): http://framework.zend.com
  2. Place the Zend-folder (located in the folder library in the Zend-download) in /var/www/DenisApp/application/../library
  3. Hit F5
Peter van der Wal
  • 11,141
  • 2
  • 21
  • 29
0
  • Download the latest framework (actually 'Zend Framework 2.3.1 Full'):

    http://framework.zend.com/downloads/latest

  • Extract it to a folder near your application. Ie: /home/app/public_html/

  • Then prepare the Path in your php code:

set_include_path('/home/app/public_html/ZendFramework-2.3.1/library');

  • So you can use the Autoload class to initialize the framework:

$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));

$loader->register();

  • So you can call the classes you need. Example:

$mail = new Zend\Mail\Storage\Maildir(array('dirname' => "/path/to/maildir"));

Marcelo Amorim
  • 1,662
  • 23
  • 23