php项目服务器如何运行,php – 如何在服务器上部署和运行zend项目?

我有一个关于在服务器上部署Zend项目的问题.在localhost上,我使用虚拟主机将文档根目录设置为public / index.php文件夹.

>我现在应该如何部署它?

我已经在服务器上复制了整个项目但由于我的所有路径都是错误的(因为所有路径都是相对于公共文件夹设置的)所以它不能正常工作.

>我该怎么办?是否可以在服务器上设置相对于我的主路径的所有路径?在这种情况下,如何将我的应用程序重定向到任何控制器?

或者我可能只需要在服务器上创建虚拟主机,但我没有权限这样做:/?

我需要一些建议,谢谢

Application.ini:

[production]

phpSettings.display_startup_errors = 0

phpSettings.display_errors = 0

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

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

resources.view[] =

resources.db.isDefaultTableAdapter = true

resources.db.adapter = PDO_MYSQL

resources.db.params.charset = "utf8"

resources.db.params.host = HOST

resources.db.params.username = "p"

resources.db.params.password = "***"

resources.db.params.dbname = "p"

[staging : production]

[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

index.php文件:

// Define path to application directory

defined('APPLICATION_PATH')

|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

// Define application environment

defined('APPLICATION_ENV')

|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));

defined('DESTINATION_IMAGES') || define('DESTINATION_IMAGES', './usersImages/');

defined('TRUE_STORY_EMAIL') || define('TRUE_STORY_EMAIL', 'mmm@gmail.com');

defined('TRUE_STORY_NAME') || define('TRUE_STORY_NAME', 'True story team');

// 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';

// Create application, bootstrap, and run

$application = new Zend_Application(

APPLICATION_ENV,

APPLICATION_PATH . '/configs/application.ini'

);

$application->bootstrap()

->run();

.htaccss:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} -s [OR]

RewriteCond %{REQUEST_FILENAME} -l [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$- [NC,L]

RewriteRule ^.*$index.php [NC,L]

的phpinfo();

w加载的模块我有mod_rewrite所以可能已启用.

—————————–

——–编辑04.05.2011 —–

我已经在服务器上再次部署了项目,并设置了RewriteBase / ~user2 / Project2 / public

现在URL映射正在工作(可能是第一次在我部署它时出错,这就是它无法正常工作的原因).

但我仍然有项目的问题.当我去Auth控制器时:

public function indexAction() {

// action body

$form = new Application_Form_Login();

$request = $this->getRequest();

if ($request->isPost()) {

if ($form->isValid($request->getPost())) {

try {

if ($this->_process($form->getValues())) {

$userDT = new Application_Model_DbTable_User();

$idUser = Zend_Auth::getInstance()->getIdentity()->id;

if ($userDT->isConfirmed($idUser)) {

$this->_helper->redirector->gotoRoute(

array(

'controller' => 'index',

'action' => 'index'

)

);

} else {

$form->setDescription('Your account is not confirmed!');

Zend_Auth::getInstance()->clearIdentity();

$this->_helper->redirector->gotoRoute(

array(

'controller' => 'Registration',

'action' => "step",

'idUser' => $idUser

)

);

}

} else {

$form->setDescription('There was an error. Try to log in once again please');

}

} catch (Exception $e) {

echo $e->getMessage();

}

}

}

$this->view->form = $form;

}

在页面上我只能看到:我不知道这意味着什么,因为我检查重定向在不同的Controller工作是什么意思,我的项目看到zend库所以我不明白为什么它不创建表单在视图中?

风景:

<?php $this->headTitle('Login'); ?>

Login

<?php echo $this->form->setAction($this->url()); ?>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值