gpt4 book ai didi

php - zend 框架重定向问题 : Invalid controller specified

转载 作者:行者123 更新时间:2023-11-30 23:03:35 24 4
gpt4 key购买 nike

我正在用 zend framework 1.12 开发一个项目

如果我将所有文件都保存在根文件夹中,一切正常,但如果创建一个新文件夹并将所有文件移动到其中,则没有任何效果。

以下是我的文件夹结构应用图书馆民众索引.php.htaccess

.htaccess

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^js/(.*)$ public/js/$1 [L]
RewriteRule ^images/(.*)$ public/images/$1 [L]
RewriteRule ^css/(.*)$ public/css/$1 [L]
RewriteRule ^.*$ index.php [NC,L]

应用程序/配置/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.moduleDirectory = APPLICATION_PATH "/modules"

resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.frontController.baseUrl = "/"

resources.session.remember_me_seconds = 864000


[staging : production]

[testing : production]

[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
resources.db.adapter = "PDO_MYSQL"
resources.db.params.host = "localhost"
resources.db.params.username = "root"
resources.db.params.password = "root123"
resources.db.params.dbname = "labs"
resources.db.isDefaultTableAdapter = true
resources.db.params.profiler.enabled = true
resources.db.params.profiler.class = Zend_Db_Profiler_Firebug
includePaths.models = APPLICATION_PATH "/models/"
resources.frontController.baseUrl = "/"

如果我移动 labs/中的所有文件夹并将 application.ini 更改为
resources.frontController.baseUrl = "/labs/"

http://domainname/  : Works fine     
https://domainname/labs : gives error

如何解决这个问题。我想将所有文件放在新文件夹中,以便在根目录下我可以创建更多项目。

错误

An error occurred
Page not found
Exception information:

Message: Invalid controller specified (labs)
Stack trace:

#0 /var/www/html/labs/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#1 /var/www/html/labs/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#2 /var/www/html/labs/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#3 /var/www/html/labs/index.php(30): Zend_Application->run()
#4 {main}

Request Parameters:

array (
'controller' => 'labs',
'action' => 'index',
'module' => 'default',
)

最佳答案

也许您需要更改配置文件中的“baseUrl”。

resources.frontController.baseUrl = "/labs/"

也许是这样的:How to set baseUrl

关于php - zend 框架重定向问题 : Invalid controller specified,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22807385/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com