Part of the EllisLab Network
   
 
Installation on Ubuntu, Apache 2
Posted: 21 January 2008 03:08 PM   [ Ignore ]  
Summer Student
Total Posts:  17
Joined  01-21-2008

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?):

<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:

$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!

 Signature 

Juan Delgado - Zárate
http://zarate.tv

Profile
 
 
Posted: 21 January 2008 03:27 PM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1239
Joined  01-07-2008
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:

$config['index_page'] = "";

 Signature 

Blog | Twitter | Coffee

Profile
 
 
Posted: 21 January 2008 03:36 PM   [ Ignore ]   [ # 2 ]  
Summer Student
Total Posts:  17
Joined  01-21-2008

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://codeigniter.com/user_guide/general/controllers.html

which reads:

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!

 Signature 

Juan Delgado - Zárate
http://zarate.tv

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 719, on June 06, 2008 10:16 AM
Total Registered Members: 62604 Total Logged-in Users: 16
Total Topics: 77091 Total Anonymous Users: 1
Total Replies: 416307 Total Guests: 180
Total Posts: 493398    
Members ( View Memberlist )
Newest Members:  wengbaoshanGenki1gabewellsGlaucoeudj1nsehartEasyMLance SloanandrewjhscottShuvo