Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZF] Warning: require_once(IndexController.php), failed to open stream
phpion
post
Post #1





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Witam,
muszę napisać pewną aplikację w ZF ale już na starcie mam pewien problem.

Tak wygląda mój index.php:
  1. <?php
  2. // Autoload function
  3. require_once('./__autoload.php');
  4.  
  5. // Set include path for autoload function
  6. set_include_path('/home/phpion/public_html/nanana/libraries:'.get_include_path());
  7.  
  8. // Connect to database...
  9. $db = Zend_Db::factory('Pdo_Mysql', array(
  10. 'host'  => 'localhost',
  11. 'username' => 'root',
  12. 'password' => '',
  13. 'dbname'  => 'nanana'
  14. ));
  15.  
  16. // ...and set it as a default database adapter
  17. Zend_Db_Table_Abstract::setDefaultAdapter($db);
  18.  
  19. // Controllers array
  20. $controllers = array(
  21. 'frontend' => '/home/phpion/public_html/nanana/applications/frontend/controllers',
  22. //'backend' => '/home/phpion/public_html/nanana/applications/backend/controllers'
  23. );
  24.  
  25. // Set & run the front controller
  26. $frontController = Zend_Controller_Front::getInstance();
  27. $frontController->setControllerDirectory($controllers);
  28. $frontController->setDefaultModule('frontend');
  29.  
  30. $frontController->dispatch();
  31. ?>


Wywolanie w przeglądarce wywala:
Kod
Warning: require_once(IndexController.php): failed to open stream: No such file or directory in blablabla


Gdy dodam ścieżkę do kontrolerów do include_path wszystko śmiga:
  1. <?php
  2. // Set include path for autoload function
  3. set_include_path('/home/phpion/public_html/nanana/libraries:/home/phpion/public_html/nanana/applications/frontend/controllers:'.get_include_path());
  4. ?>


O ile dobrze pamiętam przy poprzednim kontakcie z ZF nie musiałem dodawać tej ścieżki. Gdzie robię błąd? O czym zapomniałem?

Pozdrawiam: pion
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 23.08.2025 - 01:37