Php 多域Zend框架
我想在多个域上运行Zend Framework。在1个域上,我有2个不同的应用程序的整个应用程序。ini的每个域一个。 在另一个域上,我只复制了公用文件夹。但是我似乎无法运行第二个域,可能是index.php中的某些内容。希望你们能帮助我Php 多域Zend框架,php,zend-framework,Php,Zend Framework,我想在多个域上运行Zend Framework。在1个域上,我有2个不同的应用程序的整个应用程序。ini的每个域一个。 在另一个域上,我只复制了公用文件夹。但是我似乎无法运行第二个域,可能是index.php中的某些内容。希望你们能帮助我 <?php header("Content-type: text/html; charset=utf-8"); // Define path to application directory defined('APPLICATION_PATH')
<?php
header("Content-type: text/html; charset=utf-8");
// Define path to application directory
defined('APPLICATION_PATH')
|| define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../../DOMAIN_WITH_APPLICATION_MAP/application'));
// Define application environment
defined('APPLICATION_ENV')
|| define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'development'));
// Ensure library/ is on include_path
set_include_path(implode(PATH_SEPARATOR, array(
realpath(APPLICATION_PATH . '/../../DOMAIN_WITH_APPLICATION_MAP/library'),
get_include_path(),
)));
/** Zend_Application */
require_once 'Zend/Application.php';
require_once 'Zend/Loader/Autoloader.php';
$loader = Zend_Loader_Autoloader::getInstance ();
$loader->setFallbackAutoloader ( true );
$loader->suppressNotFoundWarnings ( false );
// Create application, bootstrap, and run
$application = new Zend_Application(
APPLICATION_ENV,
APPLICATION_PATH . '/configs/application2.ini'
);
$application->bootstrap()
->run();
您需要更新服务器配置。如果您使用的是apache,则需要使用ServerAlias,这将允许您将内容从主域映射到别名域。例如:
<VirtualHost *:80>
ServerName www.mysite.co.uk
ServerAlias www.mysite2.co.uk www.mysite3.co.uk
</VirtualHost>
服务器名www.mysite.co.uk
ServerAlias www.mysite2.co.uk www.mysite3.co.uk
您的vhost配置是什么样子的?