创建 Zend index.phtml 后的空白主页

发布于 2024-12-02 03:24:35 字数 896 浏览 3 评论 0原文

我刚刚开始使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拥抱我好吗 2024-12-09 03:24:35

要做的第一件事是确保为开发启用了适当的错误报告。确保在您的 application.ini 文件中设置这些内容。

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

完成此操作后,重新测试并发回您收到的任何错误消息。

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 file

phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Once you've done this, re-test and post back any error messages you receive.

独木成林 2024-12-09 03:24:35

看来您没有在 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/?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文