3

I have a web application developed using codeigniter and it worked fine in my previous server now I changed my server and when I am trying to run the web application there is nothing but a blank screen.

When I am trying to open the existing link http://mydomain.com/MyProject1/ It's a valid link but its showing me a blank page.

When I am trying to open another existing link mydomain.com/MyProject1/login/ This too a valid link but its displaying just a blank page.

Just for a test I tried some wrong link http://mydomain.com/MyProject1/test It's showing 404 error.

So, must be the code is running fine but pages are not being displayed. It's only showing blank page.

How can I fix this issue?

4
  • What was your url like when you were working in the local environment? Has the structure changed? Commented Mar 25, 2013 at 8:10
  • No, not even the domain name changed. Everything is same. Commented Mar 25, 2013 at 8:17
  • Check the rewrite module enbled or not? Commented Mar 25, 2013 at 8:23
  • Which editor are you using to save the files? Are you using "utf-8 without BOM" for encoding files? Commented Mar 25, 2013 at 8:47

5 Answers 5

2

Ok, turn displaying error in index.php (it's in the root) and change this if condition to something like:

if (defined('ENVIRONMENT'))
{
    switch (ENVIRONMENT)
    {
        case 'development':
            error_reporting(E_ALL ^ E_NOTICE);
        break;

        case 'testing':
        case 'production':
            // error_reporting(0);
            error_reporting(E_ALL ^ E_NOTICE);
        break;

        default:
            exit('The application environment is not set correctly.');
    }
}

Then the errors show up.

Btw. try to set the correct htaccess path to your app if you are using it e.g. if on your localhost it was:

RewriteEngine On

RewriteBase /projects/mywebsite/

change it on server to:

RewriteEngine On

RewriteBase /

if you are not using subdomains etc., of course.

Btw. if you get an error like headers already sent or something like that, you will need to save your files as "utf-8 without BOM" instead just "utf-8". Or there might be some characters on the beginning of the file, which you need to delete in your text editor.

Check the files you are working with e.g. language files, views, controllers etc. and check them how are they encoded. If they are utf-8 change encoding to utf-8 without BOM. It can be done in almost every text editor like Notepad++ or Sublime. Then reupload these files to your server.

Sign up to request clarification or add additional context in comments.

Comments

1

Try with

http://mydomain.com/MyProject1/index.php/test

may be you are missing index.php,or else goto "config.php" and edit base url and index url as per your application like

$config['base_url'] = 'http://mydomain.com/MyProject1/';
$config['index_page'] = '';//Keep this as empty

1 Comment

This is where I'd check first (see if it works with index.php in the URL). But usually it's an issue with .htaccess when you get these symptoms when moving hosts, not that index_page is empty or base_url is wrong.
0

Try to echo the warnings, will let you know why the page is not loading. Go to your index.php page in the root of your CI folder and insert the following:

ini_set('display_errors', 1);

Comments

0

If you have access to .htaccess file, on the first line paste the following code:

php_flag display_startup_errors on

php_flag display_errors on

php_flag html_errors on

Servers usually listens to htaccess php_flag better than ini_set php function. I had the same problem when I first installed Codeigniter.

Comments

0

Check to see if you have enabled gzip in codeigniter. If you have gzip enabled and you are echoing stuff back then you might see blank page.

Try to use the output class of the codeigniter.

If it wasnt the case then try @MehrdadDastgir suggestion of using

ini_set('display_errors', 1);

and see what error its throwing.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.