I have been developing a small web application with CodeIgniter. After testing it out locally I went to put it on my web server to allow a couple other people test out some
I had the same problem. Changing controlers first letter to uppercase helped.
I was able to fix similar errors by changeing
http://ip-address/html/ci3-fire-starter/htdocs/index.php/
on the application/config/config.php line 26.
There are a number of things you can check here. I'll go over each one with you.
1, When moving to a live server from localhost(htdocs) you need to make sure that the version of PHP you are using is supported.
To test this: Create an 'index.php' file and add the below line only.
<?php phpinfo(); ?>
Just press 'Ctrl + F' and search "version". You will find the php version. It may need to be 5.3+ to support features.
2,
Check your config/config.php
and check your $config['base_url']
and $config['index_page']
screen shot below
I recommend putting site name in the base url example: 'www.site.com/
'
but remove the index.php for cleaning.
3, MOST LIKELY THE REASON SO START WITH THIS
It most likely is the .htaccess file. Here is mine Made by Elliot Haughton. Put this in your root directory and change line 9 'RewriteBase /' if necessary.
<IfModule mod_rewrite.c>
RewriteEngine On
# !IMPORTANT! Set your RewriteBase here and don't forget trailing and leading
# slashes.
# If your page resides at
# http://www.example.com/mypage/test1
# then use
# RewriteBase /mypage/test1/
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
<IfModule !mod_rewrite.c>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
(Make sure you use both parts above. The editor broke it in two but all code above is one .htaccess file).
If none of the above works, give me a shout back and we'll step through it.
I was stuck with this approx a day i just rename filename "Filename" with capital letter and rename the controller class "Classname". and it solved the problem.
**class Myclass extends CI_Controller{}
save file: Myclass.php**
application/config/config.php
$config['base_url'] = '';
Try to add following line in root folder index.php after php starts:
ob_start();
This works for me.