简体   繁体   中英

Zend redirects to MAMP PRO index page

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)

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...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM