0

我只是想知道是否其他人在将 Zend 框架从开发转移到生产时遇到了问题。

我将我的 docroot 更改为公用文件夹,更新了我的库路径,但它仍然不适合我。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;
  }
}
4

2 回答 2

1

尝试回显 APPLICATION_PATH 以查看您是否有正确的路径。此外,请注释掉与在您的模型中实例化 Zend 有关的所有代码(在您执行包含之后),并查看是否出现错误。

此外,尝试使用您的 .htaccess 文件进行试验。您可能只是在那里发生了一些与您的托管服务提供商无关的问题。

于 2010-05-29T20:41:31.803 回答
1

感谢您今天的帮助,杰森。实际上,我通过将我的 .htaccess 文件从默认值调整为其他文件来使其正常工作。显然 ZF 与 1and1 配合得不好。这是我为使其正常工作所做的:

AddType x-mapp-php5 .php

<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^domain\.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301,L]
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
</IfModule>
于 2010-05-29T21:38:36.180 回答