首先抱歉,但我是一个非常大的初学者,所以如果你愿意,你可以投下这个问题。FuelPHP从网址删除公众
所以我去了很多的教程,唯一能为我工作的是拉出公用文件夹的内容。
而问题是我得到了一堆的错误。
错误:
Warning: require(\bootstrap.php) [function.require]: failed to open stream: No such file or directory in C:\EasyPHP\www\fuelphp\index.php on line 33
Fatal error: require() [function.require]: Failed opening required '\bootstrap.php' (include_path='.;C:\php\pear') in C:\EasyPHP\www\fuelphp\index.php on line 33
,所以我发现DOCROOT是C:\EasyPHP\www\fuelphp\
,所以我需要拉东西,在这样本地主机/ fuelphp /燃油/核心
原来的指数看起来像这样
<?php
/**
* Set error reporting and display errors settings. You will want to change these when in production.
*/
error_reporting(-1);
ini_set('display_errors', 1);
/**
* Website document root
*/
define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);
/**
* Path to the application directory.
*/
define('APPPATH', realpath(__DIR__.'/../fuel/app/').DIRECTORY_SEPARATOR);
/**
* Path to the default packages directory.
*/
define('PKGPATH', realpath(__DIR__.'/../fuel/packages/').DIRECTORY_SEPARATOR);
/**
* The path to the framework core.
*/
define('COREPATH', realpath(__DIR__.'/../fuel/core/').DIRECTORY_SEPARATOR);
// Get the start time and memory for use later
defined('FUEL_START_TIME') or define('FUEL_START_TIME', microtime(true));
defined('FUEL_START_MEM') or define('FUEL_START_MEM', memory_get_usage());
// Boot the app
require APPPATH.'bootstrap.php';
// Generate the request, execute it and send the output.
try
{
$response = Request::forge()->execute()->response();
}
catch (HttpNotFoundException $e)
{
$route = array_key_exists('_404_', Router::$routes) ? Router::$routes['_404_']->translation : Config::get('routes._404_');
if ($route)
{
$response = Request::forge($route)->execute()->response();
}
else
{
throw $e;
}
}
// This will add the execution time and memory usage to the output.
// Comment this out if you don't use it.
$bm = Profiler::app_total();
$response->body(
str_replace(
array('{exec_time}', '{mem_usage}'),
array(round($bm[0], 4), round($bm[1]/pow(1024, 2), 3)),
$response->body()
)
);
$response->send(true);
比修饰以这种
<?php
/**
* Set error reporting and display errors settings. You will want to change these when in production.
*/
error_reporting(-1);
ini_set('display_errors', 1);
/**
* Website document root
*/
define('DOCROOT', '/');
/**
* Path to the application directory.
*/
define('APPPATH', 'fuel/app/').DIRECTORY_SEPARATOR;
/**
* Path to the default packages directory.
*/
define('PKGPATH', 'fuel/packages/').DIRECTORY_SEPARATOR;
/**
* The path to the framework core.
*/
define('COREPATH', 'fuel/core/').DIRECTORY_SEPARATOR;
// Get the start time and memory for use later
defined('FUEL_START_TIME') or define('FUEL_START_TIME', microtime(true));
defined('FUEL_START_MEM') or define('FUEL_START_MEM', memory_get_usage());
// Boot the app
require APPPATH.'bootstrap.php';
// Generate the request, execute it and send the output.
try
{
$response = Request::forge()->execute()->response();
}
catch (HttpNotFoundException $e)
{
$route = array_key_exists('_404_', Router::$routes) ? Router::$routes['_404_']->translation : Config::get('routes._404_');
if ($route)
{
$response = Request::forge($route)->execute()->response();
}
else
{
throw $e;
}
}
// This will add the execution time and memory usage to the output.
// Comment this out if you don't use it.
$bm = Profiler::app_total();
$response->body(
str_replace(
array('{exec_time}', '{mem_usage}'),
array(round($bm[0], 4), round($bm[1]/pow(1024, 2), 3)),
$response->body()
)
);
$response->send(true);
现在公众是不是在URL,但即时得到一堆错误,当我打开网站,我看到insted的UTS反斜杠斜杠的,但不能真正找到问题
Warning: require_once(fuel/core/classes\error.php) [function.require-once]: failed to open stream: No such file or directory in C:\EasyPHP\www\fuelphp\fuel\core\base.php on line 25
Fatal error: require_once() [function.require]: Failed opening required 'fuel/core/classes\error.php' (include_path='.;C:\php\pear') in C:\EasyPHP\www\fuelphp\fuel\core\base.php on line 25
可以请别人给我一个提示如何修改索引是否可以?
谢谢
添加到htaccess的根,现在工作得很好,最后一个问题是可以安全使用这个htaccess的?因为现在我可以通过这种方式访问它http:// localhost/fueljob /和这种方式http:// localhost/fueljob/public,这不是一个问题吗? – Side 2012-08-02 09:00:46
这不是问题,不。如果你真的想要使用.htaccess通过后面的URL访问它,你可以拒绝访问,但这不是问题,是的,我会说它是安全的使用。 – 2012-08-02 09:05:08
非常感谢你的帮助 – Side 2012-08-02 09:06:44