Welcome Guest, Not a member yet? Register   Sign In
controller codeigniter in ubuntu linux not run
#1

[eluser]tusukgigi[/eluser]
hi,
i installed codeigniter in ubuntu linux with lampp.
when i point to localhost/codeigniter/home in my browser,

Not Found

The requested URL /codeigniter/home was not found on this server.

Code:
<?php

class Home extends Controller {

    function __Construct()
    {
        parent::Controller();    
    }
    
    function index()
    {
        //$this->load->view('welcome_message');
        echo "Hello home, I was here:D ";
    }
}

how to fix it.
(sorry for my english Smile)
#2

[eluser]Basketcasesoftware[/eluser]
First question. Which version of CodeIgniter are you using? From the code sample it looks like you are using either 1.7.2 or 1.7.3, maybe 2.0 would fix it. If not, what is your directory structure where you have CodeIgniter. I use XAMPP myself so I don't how LAMP is configured, but I know I've seen postings here where the localhost address is followed by a port number. I don't know if lamp is one of those that requires that or not. Again, without more knowledge of your system setup it's difficult to formulate an adequate solution.
#3

[eluser]tusukgigi[/eluser]
yes, im using 1.7.3 version.
so far, i using version 1.7.3 in xampp [windows]and running well.
code above, if I type localhost/codeIgniter,
running well.welcome message will run in the show.
but if I added a method on the welcome controller,
could not walk properly
Code:
<?php

class Home extends Controller {

    function __Construct()
    {
        parent::Controller();    
    }
    
    function index()
    {
        //$this->load->view('welcome_message');
        echo "Hello home, I was here:D ";
    }
}
thankq
#4

[eluser]mi6crazyheart[/eluser]
@tusukgigi Dude, CONTROLLER is not the right place for echoing any thing. That's why u can't able to see u'r echo statement. BDW, try this... i hope u can now see the VIEW page.. ;-P

Code:
function index()
{
echo "Hello home, I was here:D ";
$this->load->view('welcome_message');
}
#5

[eluser]mi6crazyheart[/eluser]
[quote author="tusukgigi" date="1298209962"]hi,
i installed codeigniter in ubuntu linux with lampp.
when i point to localhost/codeigniter/home in my browser,

Not Found

The requested URL /codeigniter/home was not found on this server.

Code:
<?php

class Home extends Controller {

    function __Construct()
    {
        parent::Controller();    
    }
    
    function index()
    {
        //$this->load->view('welcome_message');
        echo "Hello home, I was here:D ";
    }
}

how to fix it.
(sorry for my english Smile)[/quote]

Try this url & tell me :
Code:
/codeigniter/index.php/home
#6

[eluser]Basketcasesoftware[/eluser]
[quote author="mi6crazyheart" date="1298237197"]@tusukgigi Dude, CONTROLLER is not the right place for echoing any thing. That's why u can't able to see u'r echo statement. BDW, try this... i hope u can now see the VIEW page.. ;-P

Code:
function index()
{
echo "Hello home, I was here:D ";
$this->load->view('welcome_message');
}
[/quote]

Ummm. I use echo in my controllers all the time. If the code is working they show up. That isn't the reason. It's not recommended because it violates MVC patterning. But CodeIgniter isn't strict MVC anyways.
#7

[eluser]Basketcasesoftware[/eluser]
Oh. And I'd upgrade to 2.0. You'll have fewer headaches in the long run.
#8

[eluser]tusukgigi[/eluser]
[quote author="mi6crazyheart" date="1298237419"][quote author="tusukgigi" date="1298209962"]hi,
i installed codeigniter in ubuntu linux with lampp.
when i point to localhost/codeigniter/home in my browser,

Not Found

The requested URL /codeigniter/home was not found on this server.

Code:
<?php

class Home extends Controller {

    function __Construct()
    {
        parent::Controller();    
    }
    
    function index()
    {
        //$this->load->view('welcome_message');
        echo "Hello home, I was here:D ";
    }
}

how to fix it.
(sorry for my english Smile)[/quote]

Try this url & tell me :
Code:
/codeigniter/index.php/home
[/quote]


yay,
two thumbs up for you.
i forgot old rule.

I had been using htaccess on windows,
but if I copy my website folder from windows, it always appears not found in browser.

for example I copy a folder from the folder htdocs /mywebsite/ on windows along with htaccess file.
if I point to the browser,
always appear

Forbidden

You do not have permission to access mywebsite on this server.
-------------
already be set to chmod 777
What should I do

thankq
#9

[eluser]mi6crazyheart[/eluser]
[quote author="Basketcasesoftware" date="1298248674"][quote author="mi6crazyheart" date="1298237197"]@tusukgigi Dude, CONTROLLER is not the right place for echoing any thing. That's why u can't able to see u'r echo statement. BDW, try this... i hope u can now see the VIEW page.. ;-P

Code:
function index()
{
echo "Hello home, I was here:D ";
$this->load->view('welcome_message');
}
[/quote]

Ummm. I use echo in my controllers all the time. If the code is working they show up. That isn't the reason. It's not recommended because it violates MVC patterning. But CodeIgniter isn't strict MVC anyways.[/quote]

Of-course, i agree with u dude... :-)




Theme © iAndrew 2016 - Forum software by © MyBB