如何将 Zend Framework 从开发转移到生产?
我只是想知道是否有其他人在将 Zend Framework 从开发转移到生产时遇到问题。
我将文档根目录更改为公共文件夹,更新了我的库路径,但它仍然不适合我。 IndexController 工作正常,但我的 ServiceController 给我一个内部服务器错误。
服务控制器
<?php
class ServiceController extends Zend_Controller_Action
{
public function amfAction()
{
require_once APPLICATION_PATH . '/models/MyClass.php';
$srv = new Zend_Amf_Server();
$srv->setClass('Model_MyClass', 'MyClass');
echo $srv->handle();
exit;
}
}
I'm just wondering if anyone else has had problems moving the Zend Framework from development to production.
I changed my docroot to the public folder, updated my library path, but it's still not working out for me. The IndexController is working just fine, but my ServiceController is giving me an internal server error.
ServiceController
<?php
class ServiceController extends Zend_Controller_Action
{
public function amfAction()
{
require_once APPLICATION_PATH . '/models/MyClass.php';
$srv = new Zend_Amf_Server();
$srv->setClass('Model_MyClass', 'MyClass');
echo $srv->handle();
exit;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试回显 APPLICATION_PATH 以查看路径是否正确。另外,请注释掉与在模型中实例化 Zend 相关的所有代码(在执行包含操作之后),并查看是否出现错误。
另外,尝试使用您的 .htaccess 文件进行试验。您可能只是遇到了一些与您的托管提供商不兼容的问题。
Try echoing APPLICATION_PATH to see if you have the correct path. Also, ry commenting out all the code pertaining to instantiating Zend in your model, (after you do the include), and see if the error comes up.
Also, try experimenting with your .htaccess file. you may just have something wrong going on there that doesn't jive with your hosting provider.
感谢杰森今天的帮助。实际上,我通过将 .htaccess 文件从默认值调整为其他内容来使其正常工作。显然ZF在1and1方面表现不佳。这就是我为使其正常工作所做的:
Thanks for your help today Jason. I actually got it working by adjusting my .htaccess file from the default to something else. Apparently ZF doesn't play nicely with 1and1. This is what I did to get it working: