douju7503 2011-07-12 18:03 采纳率: 0%
浏览 50

共享主机上的子目录上的Zend Framework

Now I'm using zf v.1.10. For deployment, I have to upload my project to a subdirectory on a shared hosting. If the domain is www.mycompany.co.id, so my project's address will be www.mycompany.co.id/myproject/. In the myproject directory, i put htaccess file like this :

RewriteEngine on

RewriteRule ^(.*)$ /myproject/public/$1

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]
RewriteRule ^public/.*$ /myproject/public/index.php [NC,L]

and in the public directory, i put htaccess file like this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

and here is my application.ini :

[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 1
resources.frontController.baseUrl = "/myproject"
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts"
resources.view.doctype = "XHTML1_TRANSITIONAL"
autoloadernamespaces.cal = "Cal_"
autoloadernamespaces.box = "Box_"
autoloadernamespaces.report = "Report_"
resources.db.adapter = PDO_MYSQL
resources.db.params.host = localhost
resources.db.params.username = uname
resources.db.params.password = p4ssw0rd
resources.db.params.dbname = myprojct

i have implemented zend_auth and zend_acl in my project, so the first page will display login form.
The problem is when i executed the form login, there's no respon.
The login form will be directed to (action is set to) "authentication" controller and "loginauth" action.
I have tried to echo something in loginauth "action", but it still displayed login form.
Whereas On my local computer (windows) everything is running well.
Please give me advice.. thanks

  • 写回答

1条回答 默认 最新

  • douhao2856 2011-07-12 19:48
    关注

    Assuming you use Zend_Form:

    You probably will have to "tell" Zend_Form to use your controller baseUrl. Try to Sub-Class Zend_Form and override the setAction() method.

    Alternatively you can use the setAction() mutator from your form instance.

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么