开发者

CodeIgniter blank screen after migration

So I have a site written using the CI framework. It worked fine on the original host (Apache). It works fine locally (IIS 7 Express). We have just purchased a new VPS (Windows Server 2008 R2) and php was pre-installed (PHP Version 5.2.10) now when I go to the site I get a blank page.

After debugging by simply printing 'OK' ever so often I determined CodeIgniter.php is failling over on:

$CI  = new $class();

Now to try and tackle the problem I have gone into config.p开发者_如何学Chp and set:

$config['log_threshold'] = 4; 

However I am not even getting any log files. I noticed the permissions were not enabled for write so I went to "c:\inetput\wwwroot" and set max permissions for user "IIS_IUSRS"

Unfortunatly still, no log file is created. "index.php" is still blank so I am totally confused. This is my first time working with a CI app. Please help!

Edit: Ensured MySQL Installed and MySQL enabled for PHP

Thanks Chris


Trevor is right. I had the same exact problem and it was resolved right after installing php-mysql. I am running this on CentOS 6.2 and I did yum install php-mysql and it worked.


Had exactly the same problem. In my case, php-mysql was installed yet didn't appear in phpinfo(). I use php-fpm (with nginx) and the reason was that php-fpm needed to be restarted

sudo /etc/init.d/php5-fpm restart


I had the same problem as the OP (execution stopped at "$CI = new $class();" in CodeIgniter.php causing a blank page), but I found my answer here: http://forum.codeigniter.com/thread-60436.html

Line 257 at system/core/Common.php was

return $_config[0] =& $config;

I changed it to

$_config[0] =& $config;
return $_config[0];

and the problem went away. It occurred after migrating from PHP 5.4 to 5.6, running CodeIgniter 2.1.


There is probably an error generated, but not shown due to the default error reporting setting. I usually change the error-reporting setting on my develop machine (in the CI index.php) like this:

  if ($_SERVER['HTTP_HOST'] == "localhost") {
    error_reporting(7);
  } else {
    error_reporting(E_ERROR);
  }


Change $config['uri_protocol'] to "REQUEST_URI".


SELF ANSWER: The cause was white spaces (Had to reformat all the code by opening each file in FTP editor and re-saving)


I had this same issue. It was because of the database settings. Check your database settings.

My issue was, I am using expression engine, and the site would go blank at the same line as you have mentioned. I am using Vagrant, so I had to set the correct port in the database config settings for Expression Engine and then it worked.


I had same problem.

To turn on errors displaying, change
define('ENVIRONMENT', 'production');
to
define('ENVIRONMENT', 'development');
in index.php.

It shows : Fatal error: Cannot redeclare class Xml in /www/.../application/libraries/Items/Xml.php on line 3

Adding if before class declaration:
if (!class_exists('Xml')) { class Xml extends XmlElement {...}
solved this problem

Also, work with
if (true) { class Xml extends XmlElement {...}
Magic! :)

P.S. I'm migrating from php 5.4.36 to 5.6.6-2 I think problem grows from php version


I had the same problem, open config/database.php file and change 'mysql' to 'mysqli' in dbdriver.

$db['default']['dbdriver'] = 'mysqli';
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜