Welcome Guest, Not a member yet? Register   Sign In
Secure Codeignitor application not able to connect to MySQL DB?
#1

[eluser]abdel[/eluser]
Hi all,

I am building a secure web application and currently, my application runs well using http. As soon as I access my application using https, I get the following error:

Database Error: Unable to connect to the database:Could not connect to MySQL

What are the complete steps to make the application secure? Please note that I don't want users to access the application through http. After reading few blogs, I did change the $config['base_url'] property to have:

Code:
$config['base_url'] = 'https://domain.com';

and my database.php is:

Code:
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'host';
$db['default']['username'] = 'root';
$db['default']['password'] = 'pass';
$db['default']['database'] = 'qwt';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
$db['default']['char_set'] = 'utf8';
$db['default']['dbcollat'] = 'utf8_general_ci';
$db['default']['swap_pre'] = '';
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;

But I still get the error (I am sure its not the URL property issue). Whenever I access my web application it seems CI is not able to connect to the DB. Also, I am having a self signed certificate on my server.
How do I get the application to connect to DB and run successfuly?

Thanks in advance.




Theme © iAndrew 2016 - Forum software by © MyBB