开发者

How do I move Zend Framework From Development to Production?

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;
  }
}


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.


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:

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜