index.php在CakePHP我不会得到它 [英] index.php in CakePHP i dont get it
问题描述
我不知道哪里有什么问题,ZIP文件只是给我,一组程序员'''''一半'的工作,现在我应该这样做,问题是,我不知道错误在哪里,当我去localhost / wookay /
I don't know where something is wrong, the ZIP file was just been given to me, and a set of programmer 'did' the 'half' of the work, and now I should do it, the problem is, I don't know where the error is, nothing shows when I go to localhost/wookay/
这里是代码:
<?php
if (!defined('DS')) {
define('DS', DIRECTORY_SEPARATOR);
}
if (!defined('ROOT')) {
define('ROOT', dirname(dirname(dirname(__FILE__))));
}
if (!defined('APP_DIR')) {
define('APP_DIR', basename(dirname(dirname(__FILE__))));
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', ROOT);
}
if (!defined('WEBROOT_DIR')) {
define('WEBROOT_DIR', basename(dirname(__FILE__)));
}
if (!defined('WWW_ROOT')) {
define('WWW_ROOT', dirname(__FILE__) . DS);
}
if (!defined('CORE_PATH')) {
if (function_exists('ini_set') && ini_set('include_path', CAKE_CORE_INCLUDE_PATH . PATH_SEPARATOR . ROOT . DS . APP_DIR . DS . PATH_SEPARATOR . ini_get('include_path'))) {
define('APP_PATH', null);
define('CORE_PATH', null);
} else {
define('APP_PATH', ROOT . DS . APP_DIR . DS);
define('CORE_PATH', CAKE_CORE_INCLUDE_PATH . DS);
}
}
if (!include(CORE_PATH . 'cake' . DS . 'bootstrap.php')) {
trigger_error("CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your " . DS . "cake core directory and your " . DS . "vendors root directory.", E_USER_ERROR);
}
if (isset($_GET['url']) && $_GET['url'] === 'favicon.ico') {
return;
} else {
$Dispatcher = new Dispatcher();
$Dispatcher->dispatch($url);
}
if (Configure::read() > 0) {
echo "<!-- " . round(getMicrotime() - $TIME_START, 4) . "s -->";
}
?>
我忘了告诉你,我对CakePHP有点noob,我通常使用smarty模板在这个过程中创建自己的框架,我确信问题在 $ Dispatcher = new Dispatcher();
之前和之后的回应, t显示后的...
I forgot to tell you, I'm a bit noob on CakePHP, I usually use smarty template and create my own framework in the process, and I'm sure that the problem lies somewhere within the $Dispatcher = new Dispatcher();
I echoed before and after, it didn't show whats after...
我更改了配置/ core.php配置::('debug',0);到Cinfigure::('debug',1);
I Changed the config/core.php Configure::('debug',0); to Cinfigure::('debug',1);
当它为0时没有显示,现在,当我将其更改为1 ,但应该是生产模式?
When it was "0" nothing was showing, now, when I changed it to "1" everything is showing, but should 0 be production mode?
推荐答案
打开错误报告,在开头添加这一行 <?php
Turn on error reporting, add this line after the opening <?php
error_reporting(E_ALL);
或通过将CakePHP的值设置为 2启用CakePHP的调试设置
您将在
or enable CakePHP's debug setting by setting its value to 2
you'll do this in
config/core.php
然后将此行更改为
Configure::write('debug', 2);
这篇关于index.php在CakePHP我不会得到它的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!