dongqiang4986 2012-01-09 12:11
浏览 48
已采纳

Zend重定向到MAMP PRO索引页面

I am using zend Framework Version 1.11.11 and I work on a Mac (OSX 10.6.8) with MAMP PRO.

I was working on a project with it before going on holiday and when I got back, whenever I tried to access the index page or a page of the website on my local version I got redirected to the MAMP Pro index page. It never happened before. Now I know that other posts had tackled this issue before, but I checked my settings against theirs and they are the same.

.htaccess

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteBase /

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


php_value upload_max_filesize 150M
php_value post_max_size 150M
php_value memory_limit 150M

index.php

<?php

// Define path to application directory
defined('APPLICATION_PATH')
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
    defined('UPLOAD_PATH')
    || define('UPLOAD_PATH', realpath(dirname(__FILE__) . '/../public'));
     defined('TRAILING_CHARS')
    || define('TRAILING_CHARS', "SHARINGAN");

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


// Create application, bootstrap, and run
$application = new Zend_Application(
    APPLICATION_ENV,
    APPLICATION_PATH . '/configs/application.ini'
);

$application->bootstrap()
            ->run();

bootstrap.php

<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{
    protected function _initActionHelpers() 
    {
        Zend_Controller_Action_HelperBroker::addPath(APPLICATION_PATH . '/controllers/helpers', 'Action_Helper');
        // Zend_Controller_Action_HelperBroker::addHelper(
     //     new Action_Helper_Common(null, $session)
        // );
        Zend_Controller_Action_HelperBroker::getHelper('Common');

    }

    protected function _initAutoloader() {
        $moduleLoader = new Zend_Application_Module_Autoloader(array(
            'namespace' => 'Action_Helper_*', 
            'basePath'  => APPLICATION_PATH . '/controllers/helpers'));
        return $moduleLoader;
    }


}

Can someone help please ?

EDIT

here is the architecture of my work folder:

/Work
   index.php (MAMP PRO)
   /Project
      /_build
         /application
           /controllers
              IndexController.php
         /views
         /scripts
             /error
                error.phtml
               .
               .
               .
             /index
               cms.phtml
               index.phtml
               add.phtml
               edit.phtml
               view.phtml
               .
               .
               .
         bootstrap.php
         /library
         /public
            /css
            /images
            /javascript
            .htaccess
            index.php(Zend index)
  • 写回答

1条回答 默认 最新

  • dsh84723 2012-01-10 10:44
    关注

    Hi I just got around the issue. In my htaccess there was no need of a Rewrite Base, I think that is what redirected to MAMP Pro index page. I also deleted the explicit mention of the BaseUrl in my application.ini but I don't think it was necessary. Hope it helps someone...

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)