Сначала извините, но я действительно большой новичок, поэтому вы можете проголосовать за этот вопрос, если хотите.FuelPHP remove public from url
Так что я прошел много уроков, и единственное, что сработало бы для меня, это вытащить содержимое общедоступной папки.
И проблема в том, что я получаю кучу ошибок.
ошибка:
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
Это не проблема, нет. Вы можете запретить доступ при доступе к нему через последний URL-адрес, используя .htaccess, если вы действительно этого хотели, но это не проблема, и да, я бы сказал, что это безопасно использовать. –
Большое вам спасибо за помощь – Side