【发布时间】:2011-08-11 00:26:04
【问题描述】:
我希望我服务器上的 public_html 文件夹成为我的 zend 项目中的公用文件夹。 你们知道我该怎么做吗?现在我必须使用 domain.com/public 查看我的网站
我尝试将 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'));
// 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();
但这不起作用。知道如何解决这个问题吗?
基本上我想要一个这样的目录结构:
public_html/
----application/
----library/
----index.php
或者还有其他方法可以实现吗?无论如何,我想从我的 URL 中删除“公开”。
有什么想法吗?
【问题讨论】:
标签: php zend-framework directory public