Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Zend]Fatal error: Uncaught exception 'Zend_View_Exception'
Lonas
post 17.04.2008, 12:09:33
Post #1





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


Hej - uczę się Zend na podstawie tutoriala http://blog.heavymind.net/zend-framework-tutorial/#1000

wykonalem poszczegolne kroki w nim zawarte to jest storzylem strukture katalogow, umiescilem Zend w bibliotekach
bootstraper wyglada :

  1. <?php
  2. error_reporting(E_ALL|E_STRICT);
  3. date_default_timezone_set('Europe/London');
  4. set_include_path('.' . PATH_SEPARATOR . './library'
  5.  . PATH_SEPARATOR . './application/models/'
  6.  . PATH_SEPARATOR . get_include_path());
  7.  
  8. include "Zend/Loader.php";
  9. Zend_Loader::loadClass('Zend_Controller_Front');
  10.  
  11. // setup controller
  12. $frontController = Zend_Controller_Front::getInstance();
  13. //$frontController->setBaseUrl('/zf-tutorial/');
  14. $frontController->throwExceptions(true);
  15. $frontController->setControllerDirectory('./application/controllers');
  16.  
  17. // run!
  18. $frontController->dispatch();
  19. ?>


IndexController
  1. <?php
  2. class IndexController extends Zend_Controller_Action {
  3.  function indexAction() {
  4. echo "<p>in IndexController::indexAction()</p>";
  5.  }
  6.  
  7.  function addAction() {
  8. echo "<p>in IndexController::addAction()</p>";
  9.  }
  10.  
  11.  function editAction() {
  12. echo "<p>in IndexController::editAction()</p>";
  13.  }
  14.  
  15.  function deleteAction() {
  16. echo "<p>in IndexController::deleteAction()</p>";
  17.  }
  18. }
  19. ?>


plik .htaccess
RewriteEngine on
RewriteRule .* index.php

php.ini
php_flag magic_quotes_gpc off
php_flag register_globals off

próbuje wywolac adres http://localhost:88/zf-tutorial ktory ma pokazac nazwe akcji
i dostaje fatal error
  1. Fatal error: Uncaught exception 'Zend_View_Exception' with message 'script 'index/index.phtml' not found in path (.\application\views\scripts\)' in C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\View\Abstract.php:857 Stack trace: #0 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\View\Abstract.php(765): Zend_View_Abstract->_script('index/index.pht...') #1 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(895): Zend_View_Abstract->render('index/index.pht...') #2 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(916): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/index.pht...', NULL) #3 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Controller\Action\Helper\ViewRenderer.php(955): Zend_Controller_Action_Helper_ViewRenderer->render() #4 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Controller\Action\HelperBroker.php(161): Zend_Controller_Action_Helper_ViewRenderer->postDispatch( in C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\View\Abstract.php on line 857


Nie wiem w czym jest problem - czy w apache cos jeszcze musze ustawiac ? Mam zainstalowen WebServ na porcie 88

Ten post edytował Lonas 17.04.2008, 12:11:15


--------------------
Go to the top of the page
+Quote Post
Sabistik
post 17.04.2008, 12:36:09
Post #2


Administrator wortalu


Grupa: Przyjaciele php.pl
Postów: 960
Pomógł: 39
Dołączył: 21.10.2003
Skąd: Kraków

Ostrzeżenie: (0%)
-----


Nie utworzyłeś odpowiedniego szablonu widoku dla Twojej akcji.
Go to the top of the page
+Quote Post
Lonas
post 18.04.2008, 13:09:02
Post #3





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


W tutorialu pisalo ze to juz powinno cos wyswietlic smile.gif

W porzadku wiec sprobuje stworzyc widoki teraz

edit:

faktycznie po dodaniu widoku pojawia sie juz nazwa akcji smile.gif
No i szablon smile.gif

Pojawil sie nastepny problem z klasa oblugi bazy danych - niby wszystko mam jak w tutorialu pomimo tego jak probuje wywolac metode

  1. <?php
  2. $album = new Album();
  3. $this->view->albums = $album->fetchAll();
  4. ?>


dostaje blad
  1. Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The mysql driver is not currently installed' in C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Adapter\Pdo\Abstract.php:104 Stack trace: #0 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Adapter\Abstract.php(390): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Adapter\Pdo\Abstract.php(206): Zend_Db_Adapter_Abstract->query('DESCRIBE `album...', Array) #2 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Adapter\Pdo\Mysql.php(137): Zend_Db_Adapter_Pdo_Abstract->query('DESCRIBE `album...') #3 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Table\Abstract.php(605): Zend_Db_Adapter_Pdo_Mysql->describeTable('album', NULL) #4 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Table\Abstract.php(534): Zend_Db_Table_Abstract->_setupMetadata() #5 C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Table\Abstract.php(269): Zend_Db_Table_Abstract-> in C:\Program Files\WebServ\httpd\zf-tutorial\library\Zend\Db\Adapter\Pdo\Abstract.php on line 104


tutaj podlaczenie bazy mysql

  1. <?php
  2. Zend_Loader::loadClass('Zend_Registry');
  3. Zend_Loader::loadClass('Zend_Db');
  4. Zend_Loader::loadClass('Zend_Db_Table');
  5.  
  6.  
  7. // load configuration
  8. $config = new Zend_Config_Ini('./application/config.ini', 'general');
  9. $registry = Zend_Registry::getInstance();
  10. $registry->set('config', $config);
  11.  
  12. $db = Zend_Db::factory( $config->db->adapter,
  13. $config->db->config->toArray() );
  14. Zend_Db_Table::setDefaultAdapter($db);
  15. ?>


Ten post edytował Lonas 18.04.2008, 13:11:37


--------------------
Go to the top of the page
+Quote Post
mike
post 18.04.2008, 13:25:23
Post #4





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


Nie masz zainstalowanego sterownika mysql dla bazy danych MySQL.
Nie ma to żadnego związku z Zend Frameworkiem.
Go to the top of the page
+Quote Post
Lonas
post 18.04.2008, 13:58:36
Post #5





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


Dodalem sterownik ODBC MySql ale blad dalej wyskakuje :/


--------------------
Go to the top of the page
+Quote Post
mike
post 18.04.2008, 14:07:59
Post #6





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


O tej samej treści?

Może dodałeś mysqli a masz mysql albo odwrotnie?
Go to the top of the page
+Quote Post
GrayHat
post 19.04.2008, 23:47:35
Post #7





Grupa: Zarejestrowani
Postów: 566
Pomógł: 18
Dołączył: 23.08.2003
Skąd: Łomża

Ostrzeżenie: (0%)
-----


dodaj sterownik pdo_mysql w php.ini


--------------------
*Note: No animals were killed durning the construction of this post.
Go to the top of the page
+Quote Post
Lonas
post 21.04.2008, 08:17:24
Post #8





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

Ostrzeżenie: (20%)
X----


Pomoglo dzieki smile.gif

Pozdro


--------------------
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 16.04.2024 - 09:03