我正在使用Codeigniter,而不是错误消息,我只是得到一个空白页面.有没有办法显示PHP错误消息?当我得不到任何反馈时,很难调试.
我的环境是使用Apache的Ubuntu.
昨天我花了5个多小时试图弄清楚我的设置有什么问题.在ci213/application/controllers和views目录中,我有一个简单的site.php控制器和test.php视图.我不知道为什么这个网站不会加载.有人建议我接下来要找什么?也许记录它正常工作?如果我能得到更好的日志错误,我可以有更多的工作.
我认为它必须是codeigniter,因为我在apaches root(/ var/www)有一个index.php和index.html,在根目录有一个index2.php(/ var/www/vhosts/srp-local/htdocs),当我转到localhost/index.(php | html)或srp-local/index2.php时,页面加载并正确显示,因此php和apache正在工作.
尝试加载网站我得到一个空白页面,所以我认为它必须是CI的东西.我正在拖尾所有日志文件,唯一获得更新的是站点access.log,出现以下错误.
127.0.0.1 - - [23/Mar/2013:09:00:28 -0600] "GET / HTTP/1.1" 500 381 "-" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0"
Run Code Online (Sandbox Code Playgroud)
config.php文件
$config['base_url'] = 'http://srp-local/'; # My hosts file is configured for this.
$config['log_threshold'] = 4;
$config['log_path'] = '/var/www/vhosts/srp-local/logs/ci_error.log';
Run Code Online (Sandbox Code Playgroud)
控制器/ site.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Site extends CI_Controller
{
public function index()
{
$this->load->view('test');
}
}
Run Code Online (Sandbox Code Playgroud)
意见/ test.php的
<html>
<head>
</head>
<body>
<?php echo "PHP is working …Run Code Online (Sandbox Code Playgroud)