2012-09-08 2 views
0

나는 ZendSkeletonApplication을 사용하여 웹 응용 프로그램을 개발하기 위해 쿠분투에 Apache/PHP/MySQL이있는 로컬 웹 서버를 설치했습니다. 문서 루트 ZSA의 공용 폴더로 설정됩니다젠드 프레임 워크 2에서 커스텀 모듈을 사용하려면?

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -f [OR] 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L] 

http://localhost 요청이 제대로 index.php을 검색하십시오 ZSA의 공용 폴더 내

<VirtualHost *> 
    ServerName localhost 
    ServerAdmin [email protected] 
    DocumentRoot "/var/www/ZendSkeletonApplication/public" 
    <Directory /var/www/ZendSkeletonApplication/public> 
      Options Indexes FollowSymLinks MultiViews 
      AllowOverride All 
      Order allow,deny 
      allow from all 
    </Directory> 
    ErrorLog /var/log/apache2/error.log 
    LogLevel warn 
    CustomLog /var/log/apache2/access.log combined 
    ServerSignature On 
</VirtualHost> 

은 htaccess로 파일을 읽고 있습니다. 또한 mod_rewrite가 작동 중입니다. 마지막 줄을

RewriteRule ^.*$ test.php [NC,L] 

으로 바꿔서 테스트 해 봅니다.

다음으로 아키텍처에 익숙해지기 위해 간단한 "Hello World"모듈을 작성했습니다. 사실, 나는 다른 튜토리얼을 따라 두 개의 모듈을 썼다. 내가 http://localhost/helloworld를 요청하려고 할 때마다하지만 404 오류 나는 ZF2에서 경로를 두 번 확인

The requested URL /helloworld was not found on this server. 

를 얻을.

이 시점에서 나는 붙어 있습니다. 저는 무역으로 PHP 개발자이며 서버 관리에 대한 지식이별로 없기 때문에 설치가 잘못 될 가능성이 가장 큽니다.

내가 잘못했을지도 모르는 방향을 묻고 싶습니다. 내가 확인할 수있는 어떤 함정이 당신의 마음에오고 있습니까? 제공해야 할 정보가 있습니까?

답변

0

mod_rewrite가 실제로 작동합니다. 오류는 내가 읽은 튜토리얼 모두에있었습니다. 내가 기억할 수없는 설정을 많이 변경 한 후에 404가 500 서버 오류로 변경되었습니다. 그때만 아파치 오류 로그에 힌트를 발견했다.

두 튜토리얼에서 view/Modulename/Index/index.phtml에서 템플릿을 만드는 반면 view/modulename/index/index.phtml (소문자 이름 참고)이어야합니다. 모든 소문자 경로로 이제는 저를 위해 일하고 있습니다.

(이 같은 오류 건너 누군가가 발생하는 경우) 오류 로그에서 오류 메시지 :

[Sat Sep 08 14:38:28 2012] [error] [client 127.0.0.1] PHP Fatal error: Uncaught exception 'Zend\View\Exception\RuntimeException' with message 'Zend\View\Renderer\PhpRenderer::render: Unable to render template "helloworld/index/index"; resolver could not resolve to a file' in /var/www/ZendSkeletonApplication/vendor/zendframework/zendframework/library/Zend/View/Renderer/PhpRenderer.php:451

관련 문제