[英]Codeigniter 2 silent error on shared hosting
的index.php
define('ENVIRONMENT', 'development');
if (defined('ENVIRONMENT'))
{
switch (ENVIRONMENT)
{
case 'development':
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
break;
case 'testing':
case 'production':
error_reporting(0);
break;
default:
exit('The application environment is not set correctly.');
}
}
的.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
config.php文件
$config['base_url'] = 'http://mirror.example.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
托管提供程序使用PHP版本5.3。 但是我看不到任何東西,包括錯誤。 我不知道這里有人會感到同樣的經歷嗎?
怎么了? 提前致謝
聽起來像是服務器配置問題,也許ini_set的指令“ disable_functions”處於活動狀態,您可以訪問php.ini嗎?
如果不問你的提供者
附加信息:
我在您的配置中沒有看到問題,也許您可以嘗試添加以下內容:
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
事實證明,它不是服務器,而是編碼樣式兼容性問題:
我用這個( PHP 5.3不支持 )
$this->data['current_user'] = $this->user->get_by(array(
'id' => $this->session->userdata('user_session')['user_id']
));
代替:
$user_session = $this->session->userdata('user_session');
$this->data['current_user'] = $this->user->get_by(array(
'id' => $user_session['user_id']
));
感謝大家 :)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.