从一台服务器传输到另一台服务器时出现 Zend 框架问题
Zend framework issue in tranfer from one server to another
我已将 zend 框架从一台服务器转移到另一台服务器。
它工作正常,但 Auth 控制器不工作。它出现错误页面未找到问题,而用户登录。即使它登录用户,但在找不到页面上重定向。我不确定我需要在哪里进行更改。是服务器问题还是配置问题,因为它在我的其他服务器上工作正常。
mod_rewrite of apache 已启用,服务器指向 public with .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 ^.*$ index.php [NC,L]
application.ini
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.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.layout.layout = "default"
[staging : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
database.host = "localhost"
database.username = "xxx"
database.password = 'xxxxxx'
database.dbname = "xxx"
autoloadernamespaces[] = "Resources_"
autoloadernamespaces[] = "Plugins"
resources.frontController.plugins[] = "Plugins_ViewSetup"
index.php 在 public 文件夹中
defined('BASE_URL')
|| define('BASE_URL', 'http://11.11.11.11'); // Live
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('CHARTS_FONT_PATH')
|| define('CHARTS_FONT_PATH', realpath(dirname(__FILE__) . '/../library/Charts/fonts'));
defined('PUBLIC_FOLDER')
|| define('PUBLIC_FOLDER', 'public');
defined('DATA_UPLOAD_PATH')
|| define('DATA_UPLOAD_PATH', realpath(dirname(__FILE__) . '/data'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
/** Utilities */
require_once 'Utils.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
数据库视图访问问题存在一些问题。我只是调试代码并检查错误。固定
我已将 zend 框架从一台服务器转移到另一台服务器。 它工作正常,但 Auth 控制器不工作。它出现错误页面未找到问题,而用户登录。即使它登录用户,但在找不到页面上重定向。我不确定我需要在哪里进行更改。是服务器问题还是配置问题,因为它在我的其他服务器上工作正常。
mod_rewrite of apache 已启用,服务器指向 public with .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 ^.*$ index.php [NC,L]
application.ini
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.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"
resources.layout.layout = "default"
[staging : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[testing : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
[development : production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1
database.host = "localhost"
database.username = "xxx"
database.password = 'xxxxxx'
database.dbname = "xxx"
autoloadernamespaces[] = "Resources_"
autoloadernamespaces[] = "Plugins"
resources.frontController.plugins[] = "Plugins_ViewSetup"
index.php 在 public 文件夹中
defined('BASE_URL')
|| define('BASE_URL', 'http://11.11.11.11'); // Live
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
defined('CHARTS_FONT_PATH')
|| define('CHARTS_FONT_PATH', realpath(dirname(__FILE__) . '/../library/Charts/fonts'));
defined('PUBLIC_FOLDER')
|| define('PUBLIC_FOLDER', 'public');
defined('DATA_UPLOAD_PATH')
|| define('DATA_UPLOAD_PATH', realpath(dirname(__FILE__) . '/data'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
/** Utilities */
require_once 'Utils.php';
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application.ini'
);
$application->bootstrap()
->run();
数据库视图访问问题存在一些问题。我只是调试代码并检查错误。固定