I have codeigniter project and I want to upload in local server :192.168.x.xxx
.
But I don't know how to change base_url
in config file from localhost to local server contain IP address. How to set $config['base_url']
? Thanks
I have codeigniter project and I want to upload in local server :192.168.x.xxx
.
But I don't know how to change base_url
in config file from localhost to local server contain IP address. How to set $config['base_url']
? Thanks
I would set it some thing like
$config['base_url'] = 'http://localhost/project/';
With domain
$config['base_url'] = 'http://www.yourdomainname.com/';
End base url with /
If you don't set the base url links and css, images etc will not work properly.
try it like this :
index.php :
define('APP_URL', ($_SERVER['SERVER_PORT'] == 443 ? 'https' : 'http') . "://{$_SERVER['SERVER_NAME']}".str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']));
config.php :
$config['base_url'] = APP_URL;
reference : How to set proper codeigniter base url?
Try like this:
$config['base_url'] = 'http://192.168.3.107/pkl2017';
NOTE: pkl2017
is your project folder name.