CodeIgniter Not Working (403) Localhost (CNW403L)

The problem is when I download my web file from FTP / from CPanel. This web is based on CodeIgniter, and when I reset the configuration for adjustments on localhost, but unfortunately it didn't work, even though I did it right, what's the problem?

To make sure I made a comparison with the CodeIgniter website file that I have never uploaded to hosting provider, and the configuration standard is normal, the application can run locally, but strangely why my website was online then I want to run it on localhost instead That basic configuration doesn't work?

I've been browsing everywhere, including stackoveflow and it doesn't work. In the end I tried to hypothesize the results of some of the sources that I learned, although it did not provide explicit instructions, but it was enough to help me make a hypothesis, with the experience of a technician / troubleshooter.

Conclusion

I have done the CodeIgniter configuration standard as follows

1. config.php

$config['base_url'] = 'http://localhost/bundet';

2. database.php

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'gatewan',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => './application/cache/',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Solution

Attention! before you make the settings below, make sure you have turned off the local server (wamp / xamp)

1. .htaccess

Add RewriteBase just below RewriteEngine On

RewriteEngine On
RewriteBase /YOUR_BASE_DIRECTORY/

2. Delete all the Local Server Temporary Sessions

3. Turn on the local server again

Congratulations! problem solved, now I get a status code response 200(OK), say goodbye to the status code response 403(Forbidden)

Fix Codeigniter Not Running on Localhost Download Results via CPanel / FTP

The problem is when I download my web files from FTP / from CPanel. My web is based on CodeIgniter, and when I reset the configuration for customization on localhost, but unfortunately it doesn't work, even though I've done it correctly, what's the problem?

To make sure, I made a comparison with a CodeIgniter website file that I had never uploaded to a hosting provider, and the standard configuration was normal, the application could run locally, but strangely, why did my website that was once online and then I wanted to run it on localhost, but the basic configuration didn't work?

I have browsed everywhere including stackoverflow and it did not produce any results. In the end I tried to make a hypothesis from the results of several sources that I studied, although it did not provide explicit instructions, but it was enough to help me in making a hypothesis, and with the experience of a technician / troubleshooter.

Conclusion

I have done the standard CodeIgniter configuration as follows

1. config.php

$config['base_url'] = 'http://localhost/bundet';

2. database.php

$active_group = 'default';
$query_builder = TRUE;

$db['default'] = array(
    'dsn'   => '',
    'hostname' => 'localhost',
    'username' => 'root',
    'password' => '',
    'database' => 'gatewan',
    'dbdriver' => 'mysqli',
    'dbprefix' => '',
    'pconnect' => FALSE,
    'db_debug' => (ENVIRONMENT !== 'production'),
    'cache_on' => FALSE,
    'cachedir' => './application/cache/',
    'char_set' => 'utf8',
    'dbcollat' => 'utf8_general_ci',
    'swap_pre' => '',
    'encrypt' => FALSE,
    'compress' => FALSE,
    'stricton' => FALSE,
    'failover' => array(),
    'save_queries' => TRUE
);

Solution

Attention! Before you do the settings below, make sure you have turned off the local server (wamp/xamp)

1. .htaccess

Add RewriteBase just below RewriteEngine On

RewriteEngine On
RewriteBase /YOUR_BASE_DIRECTORY/

2. Delete all Local Server Temporary Sessions

3. Restart the Local Server

Congratulations, problem solved, now I get response status 200(OK), say goodbye to response status 403(Forbidden)


Post a Comment

Previous Next

نموذج الاتصال