[英]Codeigniter 2 silent error on shared hosting
index.php 的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 的.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
config.php config.php文件
$config['base_url'] = 'http://mirror.example.com/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
The hosting provider use PHP version 5.3. 托管提供程序使用PHP版本5.3。 But I can't see anything including errors. 但是我看不到任何东西,包括错误。 I wonder is anybody here ever feel the same experience ? 我不知道这里有人会感到同样的经历吗?
What's wrong? 怎么了? thanks in advance 提前致谢
sounds like a server configuration problem maybe is the directive "disable_functions" for ini_set active do you have access to the php.ini ? 听起来像是服务器配置问题,也许ini_set的指令“ disable_functions”处于活动状态,您可以访问php.ini吗?
if not ask your provider 如果不问你的提供者
additional information: 附加信息:
i don't see a problem in your configuration maybe you can try to add the following: 我在您的配置中没有看到问题,也许您可以尝试添加以下内容:
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;
It turns out that it is not the server, but coding style compatibility issue: 事实证明,它不是服务器,而是编码样式兼容性问题:
I use this ( not support by PHP 5.3 ) 我用这个( PHP 5.3不支持 )
$this->data['current_user'] = $this->user->get_by(array(
'id' => $this->session->userdata('user_session')['user_id']
));
Instead of: 代替:
$user_session = $this->session->userdata('user_session');
$this->data['current_user'] = $this->user->get_by(array(
'id' => $user_session['user_id']
));
Thanks everyone :) 感谢大家 :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.