[eluser]wallern[/eluser]
Here is my configuration:
my code is in the htdoc root folder, I use xampp. I have a few other websites in subfolders they worked fine, and I just moved them out leave only this website.
config.php
Code:
$config['base_url'] = "http://127.0.0.1/";
$config['base_path'] = FCPATH;
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";
.htaccess
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif|js|css|pdf|txt) [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1
</IfModule>
I use this code to test my DB connection,
Code:
echo '<pre>';
print_r($db['default']);
echo '</pre>';
echo 'Trying to connect to database: ' .$db['default']['database'];
$dbh=mysql_connect
(
$db['default']['hostname'],
$db['default']['username'],
$db['default']['password'])
or die('Cannot connect to the database because: ' . mysql_error());
mysql_select_db ($db['default']['database']);
echo '<br /> Connected OK:' ;
die( 'file: ' .__FILE__ . '--> Line: ' .__LINE__);
and it shows:
Code:
Array
(
[hostname] => localhost
[username] => root
[password] => pass
[database] => dbname
[dbdriver] => mysql
[dbprefix] =>
[pconnect] => 1
[db_debug] =>
[cache_on] =>
[cachedir] =>
[char_set] => utf8
[dbcollat] => utf8_general_ci
)
Trying to connect to database: dbname
Connected OK:file: C:\xampp\htdocs\system_newsite\application\config\database.php--> Line: 80
So I think the database connection is ok. If need any other info please let me know, I'm really run out of juice on this one. Once again, thanks for help!