Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [ZendFramework] Konfiguracja na home.pl
R4D3K
post
Post #1





Grupa: Zarejestrowani
Postów: 144
Pomógł: 12
Dołączył: 16.03.2007

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


Witam wszystkich serdecznie. Jako, że już ponad 2-3 tygodnie uczę się Zenda, postanowiłem w ramach nauki stworzyć stronę dla firmy sprzedającej meble. Posiadają już oni strony, więc także posiadają hosting, na moje nieszczęście w home.pl ;/ Aplikacja, którą stworzyłem bez problemów działa na localhoscie. Natomiast mam problemy z jej działaniem a raczej, konkretnie z 1 tylko akcją, po pozostałe działają. Problem opiszę po kolei, taką posiadam strukturę plików:
(IMG:http://images50.fotosik.pl/338/09bd3e92c3c7b8c1.png)

Rozwiązałem problem z trawersowaniem katalogów, przy pomocy pliku .htaccess (w folderze public usunąłem plik .htaccess, został tylko index.php), o takiej zawartości:
Kod
RewriteEngine On
RewriteBase /salonbiasov

RewriteCond %{REQUEST_FILENAME} !/public/ [NC]
RewriteRule ^(.*)$ /public/$1 [NC,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^public/.*$ /public/index.php [NC,L]


Wszystko ładuje się OK, oprócz 1 akcji w kontrolerze IndexController:
  1. <?php
  2.  
  3. class IndexController extends Zend_Controller_Action
  4. {
  5.  
  6. public function init()
  7. {
  8. $this->_helper->redirector->setUseAbsoluteUri(true);
  9. }
  10.  
  11. public function indexAction()
  12. {
  13. //strona glówna
  14. }
  15.  
  16. public function kontaktAction()
  17. {
  18. $tekst=new Zend_View();
  19. $tekst->setScriptPath(APPLICATION_PATH . '/views/scripts/adminstatic/');
  20. $this->view->tekst=$tekst->render('kontakt.phtml');
  21. }
  22.  
  23. public function wspolpracaAction()
  24. {
  25. $model = new Application_Model_DbTable_Wspolpraca();
  26. $this->view->dane = $model->getAll();
  27. $this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
  28. .DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'wspolpraca'
  29. .DIRECTORY_SEPARATOR;
  30. }
  31.  
  32. public function ofirmieAction()
  33. {
  34. $tekst=new Zend_View();
  35. $tekst->setScriptPath(APPLICATION_PATH . '/views/scripts/adminstatic/');
  36. $this->view->tekst=$tekst->render('ofirmie.phtml');
  37. }
  38.  
  39. public function promocjeAction()
  40. {
  41. $model = new Application_Model_DbTable_News();
  42. $this->view->dane = $model->getAllNews();
  43. $this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
  44. .DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'news'
  45. .DIRECTORY_SEPARATOR;
  46. }
  47.  
  48. public function showitemAction()
  49. {
  50. $model = new Application_Model_DbTable_Item();
  51. $id = $this->_getParam('id',1);
  52. $this->view->dane = $model->getItemByCategory($id);
  53. $this->view->path = '..'.DIRECTORY_SEPARATOR.'public'.DIRECTORY_SEPARATOR.'images'
  54. .DIRECTORY_SEPARATOR.'upload'.DIRECTORY_SEPARATOR.'items'
  55. .DIRECTORY_SEPARATOR;
  56. }
  57. }


Widok dla akcji showitemAction()
  1. <?php if(empty($this->dane)):?>
  2. <h1>BRAK ASORTYMENTU</h1>
  3. <? endif ?>
  4. <? foreach($this->dane as $k=>$v):?>
  5. <div class="item">
  6. <img src="<?=$this->thumb($this->path . $v['img'], 175, 175);?>" />
  7. <span class="name"><?=$v['nazwa'];?></span><br />
  8. <span class="price"><?=$v['cena'];?> zł</span>
  9. </div>
  10. <? endforeach ?>

problem jest z akcją showitemAction(), uruchomienie jej powoduje:
Kod
500 Internal Error
The server encountered an internal error and could not complete your request.


ale tylko na serwerze home.pl na localhoscie wszystko jest OK (IMG:style_emoticons/default/exclamation.gif)
Na początku myślałem, że to problem z routerem, więc tak rozpisałem trasy w bootstrappie:
  1. $router->addRoute('produkty7',
  2. new Zend_Controller_Router_Route('pokoj_hotelowy.html', array(
  3. 'controller'=>'index',
  4. 'action'=>'showitem',
  5. 'id'=>7,
  6. )));
  7. $router->addRoute('produkty8',
  8. new Zend_Controller_Router_Route('meble_kuchenne.html', array(
  9. 'controller'=>'index',
  10. 'action'=>'showitem',
  11. 'id'=>8,
  12. )));
  13. $router->addRoute('produkty9',
  14. new Zend_Controller_Router_Route('materace.html', array(
  15. 'controller'=>'index',
  16. 'action'=>'showitem',
  17. 'id'=>9,
  18. )));


Czy ktoś może mi pomóc odnośnie tego problemu (IMG:style_emoticons/default/questionmark.gif) Chciałbym zaznaczyć, że na nazwa.pl wszystko działa (IMG:style_emoticons/default/exclamation.gif)
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:51