创建 Zend index.phtml 后的空白主页
我刚刚开始使用 Zend,遇到一个问题,浏览 http://localhost 会呈现空白页面。我已将 httpd.conf documentroot 设置为 /var/www/HTML/public 并在 bootstrap.PHP 中启用 Zend_layout 。我的index.phtml位于.ZF手册建议的目录中。
IndexComtroller 是否必须专门调用我的index.phtml 视图?我还应该检查哪些其他事项?
非常感谢!
编辑:我检查了 httpd.conf 并注意到 mod 重写已启用。 /var/www/html/public 中的 .htaccess 文件已打开 ReWrite Engine 等。我尚未在 httpd.conf 中创建 VirtualHost 条目。我只是定义了 DocumentRoot "/var/www/html/public" 运行框架需要虚拟主机吗?
EDIT2:我使用 php -f /var/www/html/public/index.php 并收到以下内容
PHP Warning: require_once(Zend/Application.php): failed to open stream: No such
file or directory in /var/www/html/public/index.php on line 18
PHP Fatal Error: require_once(): Failed opening required 'Zend/Application.php'
(include_path=':.:/usr/share/pear:/usr/share/php') in /var/www/html/public/index.php
on line 18
I am just starting with Zend and am having an issue wherein browsing http://localhost renders a blank page. I've set httpd.conf documentroot to /var/www/HTML/public and enabled Zend_layout in bootstrap.PHP. My index.phtml is locatrd in the suggested directory per the .ZF manual.
Does IndexComtroller have to specifically call my index.phtml view? What other things should I check?
Thanks Much!
EDIT: I checked httpd.conf and noted mod rewrite is enabled. .htaccess file in /var/www/html/public has ReWrite Engine ON etc. I've not created a VirtualHost entry in httpd.conf. I simply defined DocumentRoot "/var/www/html/public" Is a virtualhost required to run the framework?
EDIT2: I used php -f /var/www/html/public/index.php and received the following
PHP Warning: require_once(Zend/Application.php): failed to open stream: No such
file or directory in /var/www/html/public/index.php on line 18
PHP Fatal Error: require_once(): Failed opening required 'Zend/Application.php'
(include_path=':.:/usr/share/pear:/usr/share/php') in /var/www/html/public/index.php
on line 18
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要做的第一件事是确保为开发启用了适当的错误报告。确保在您的
application.ini
文件中设置这些内容。完成此操作后,重新测试并发回您收到的任何错误消息。
The first thing to do is make sure you have the appropriate error reporting enabled for development. Make sure these are set in your
application.ini
fileOnce you've done this, re-test and post back any error messages you receive.
看来您没有在 include_path 中设置 Zend Framework - 您是否将安装包的 Zend 子目录 libs 文件夹复制到 /usr/share/php 中,所以您现在有一个名为 /usr/share/php/Zend/ 的目录吗?
It seems that you did not setup Zend Framework in your include_path - did you copy the Zend-subdirectory of the installation packages libs-folder into /usr/share/php, so that you now have a directory called /usr/share/php/Zend/?