Welcome Guest, Not a member yet? Register   Sign In
Installation on Ubuntu, Apache 2
#1

[eluser]Zarate[/eluser]
Hi,

Just trying the classic hello world without luck so far : (

First, I create a Wadus controller class. Then when i go to the browser:

http://localhost/zv3/index.php/wadus/

I get a 404 error. Please note that this is an error handled by CodeIgniter, not by Apache.

I think i've managed to enable mod_rewrite correctly. Doing this:

- Create a symbolic link to it:
sudo ln -s /etc/apache2/mods-available/rewrite.load /etc/apache2/mods-enabled/rewrite.load
- Updated AllowOverride directive. Open Apache 2 default config:
sudo gedit /etc/apache2/sites-available/default

And change AllowOverride value to "All"

I can see mod_rewrite loaded in phpinfo(), i've restarted Apache, i've tried this .htaccess in CodeIgniter folder (is here where it should go, right?):

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /zv3/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

</IfModule>

<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>

My config file looks like this:

Code:
$config['base_url'] = "http://localhost/zv3/";

Also tried to modify uri_protocal to all possible values to no avail :|

Can anyone help me out, please? I saw a fancy CodeIgniter demo and want to give it a go!

Thanks!
#2

[eluser]Pascal Kriete[/eluser]
Quote:http://localhost/zv3/index.php/wadus/

Since you're using mod-rewrite to remove your index.php file, your url would be:

http://localhost/zv3/wadus/

Also, make sure that the class name, file name, etc are spelled and capitalized correctly (I don't know how many times I've made this mistake)

And check that:

Code:
$config['index_page'] = "";
#3

[eluser]Zarate[/eluser]
That was it. Just for coherence filename was "Wadus.php", changing it to "wadus.php" did the trick (plus enabling mod_rewrite in Apache, i assume).

Docs should be updated to warn this clearly. Specially this page:

http://ellislab.com/codeigniter/user-gui...llers.html

which reads:

Quote:CodeIgniter would attempt to find a controller named blog.php and load it

It's true, but it should say something about filename case-sensitivity.

Thanks very much and i at least hope the research about mod_rewrite helps anyone else.

Cheers!




Theme © iAndrew 2016 - Forum software by © MyBB