Saturday, 17 August 2013

Images folder is inaccessible

Images folder is inaccessible

I have created assets folder in codeigniter now my directory structure is
as follows:
-application
-system
-assets
--images
---bg.jpg
Then I created a view main_chat_app.php
<html>
<body>
<img src="<?php echo base_url('assets/images/bg.jpg');?>"/>
<?php echo img('assets/images/bg.jpg'); ?>
</body>
</html>
then loaded view in following chat controller
<?php
Class Chat extends CI_Controller
{
public function __construct()
{
parent::__construct();
}
public function index()
{
$this->load->view('main_chat_app');
}
}
?>
In my config.php
$config['base_url']='http://localhost/127.0.0.1/CodeIgniter_2.1.4/index.php';
On my computer port 80 was busy so I had to change it to 7777 in
httpd.config with these settings I usually access chat controller as
mentioned below.
http://localhost/127.0.0.1:7777/CodeIgniter_2.1.4/index.php
(see I have to add 7777)
Do I need to specify 7777 in the base url too in config.php
but despite of doing all this images are still inaccessible.

No comments:

Post a Comment