Hi Everyone,

I am having a very hard time to figure this out. I had uploaded my CMS which is developed on the CI framework. I have configured the script with the database but however i try to access the index.php file it shows up an Internal Server Error but i could access another file ini.php which is at the same location as the index.php. I do not have .htaccess at the root. Anything that i need to take care about. Please let me know. Its very urgent.

THANKS!!

Mostly there is something wrong with the script.

Put this at the start of your index.php

error_reporting(E_ALL);
ini_set("display_errors", 1);

After that, run your script.

hi szabizs, thank you for your reply but CI has a setting defined right in the index.php file. It goes like

    define('ENVIRONMENT', 'development');
/*
 *---------------------------------------------------------------
 * ERROR REPORTING
 *---------------------------------------------------------------
 *
 * Different environments will require different levels of error reporting.
 * By default development will show errors but testing and live will hide them.
 */

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

        case 'testing':
        case 'production':
            error_reporting(0);
        break;

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

Since ENVIRONMENT is set as development it should show me the errors but strangely i am not able to access the index.php. I am literally going nuts.

Check also your setting for the display_errors directive, as szabizs suggested. If it is set to false (prior to php 5.2.4) the errors won't get displayed.

Could you display the exact error that you are getting? Along with the error log ...

no luck dude.... i tried this

if (!ini_get('display_errors')) {
    ini_set('display_errors', '1');
}
echo ini_get('display_errors');

It is a HTTP 500 error which is a very general and not telling details. Is this on your server or hosted? It would help if you could have a look at the server logs.

If it is the code of the script that causes the error you could use this very simple debugging technique: put something like a die('**************') statement on the very first line of the script and see if it gets displayed. Move this statement line down and see if it gets displayed. Repeat this process until you get the error 500 displayed. That is how you can identify the line of code where things go wrong. But it is not guaranted this method of debugging will work.

u know what broj1? i was doing that right before i saw ur post and it seems. In codeigniter's file located in system/core/codeigniter.php

        call_user_func_array(array(&$CI, $method), array_slice($URI->rsegments, 2));

this line is creating the problem. Any idea why is it?

Is this the problem regarding the version of PHP being used? Cuz i am using WAMP which is running on PHP 5.3 and its working perfectly. the application is to be hosted on a windows environment which ofcourse is IIS7.0. I did a phpinfo() function call it didnt reveal the version of PHP.

What confuses me is that i used the same CI version for another client it worked for her but for this one. both thr websites are on the same server running windows OS. Any Suggestions guys? I am also trying to get this thing resolved from my end too because i have never dealt with such an error before.

Any help would be great.

Hey guys,
It seems my code is fine. It was a server issue. I moved the entire files to another server with IIS installed. The website opened but i couldn't access the admin panel of the website after logging in. do you think i need to set some permissions to some folders. i am just guessing. This is the error i got after logging in.

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\PLESKVHOSTS\vhosts\pdocricket.com\httpdocs\TestCMS\application\controllers\admin.php:43)
Filename: libraries/Session.php
Line Number: 675

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\PLESKVHOSTS\vhosts\pdocricket.com\httpdocs\TestCMS\application\controllers\admin.php:43)
Filename: helpers/url_helper.php
Line Number: 542

in this case add at the top of the admin.php

ob_start();

And at the end add

ob_flush();

nope...that didnt help :(

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\PLESKVHOSTS\vhosts\pdocricket.com\httpdocs\TestCMS\application\controllers\admin.php:43)
Filename: libraries/Session.php
Line Number: 675

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\PLESKVHOSTS\vhosts\pdocricket.com\httpdocs\TestCMS\application\controllers\admin.php:43)
Filename: libraries/Session.php
Line Number: 675

A PHP Error was encountered
Severity: Warning
Message: Cannot modify header information - headers already sent by (output started at D:\PLESKVHOSTS\vhosts\pdocricket.com\httpdocs\TestCMS\application\controllers\admin.php:43)
Filename: helpers/url_helper.php
Line Number: 542

These errors again!!

Message: Cannot modify header information - headers already sent

I am not sure if this is related to your previous problem but this particular one is due to sending some HTML output before sending all the HTTP headers. So if you use header() php function in your admin.php script you should not send any html before this function (not even a space), or try to use output buffering as suggested by szabizs in his post.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.