Welcome Guest, Not a member yet? Register   Sign In
Apache 2.2.10 PHP 5.3.6 UBUNTU 11.10 and Codeigniter 2.1.0
#1

[eluser]Unknown[/eluser]
I've dealt with codeigniter for over 3 years now. I have code working in 1.7 , 2.0 and 2.1.
Recently I decided to upgrade my server to ubuntu 11.10. Upgrade was made on a clean hdd, so it is a completely new machine. I started transferring my old code (1.7 and 2.0) and noticed that i get 404 not found errors when I try to access URLs that are different than the default. So lets say, my site resided on example.com.
Going to
Code:
http://example.com
the default controller gets loaded,
but trying to access
Code:
http://example.com/second_controller
, returns with 404 error. At first I thought it was .htaccess error, and that my mod rewrite wasn't active. This wasn't the case. mod_rewrite is active, also I have AllowOverride all in my site config. But just to be sure I tried putting something like
Code:
RewriteRule .* http://codeigniter.com/ [L,R]

just to see if it gets redirected. And it works. I hacked around the code for a while thinking that the issues are there ( trying to find a problem in the older codeigniter versions). Then I decided that I really can't be sure with one of my sites and I need to download a fresh codeigniter. I downloaded the latest version 2.1.0. I put it on the server, made a quick setup in the config (set the base url). Created a quick controller second_controller(a copy of the default controller).And tried it, fresh from the oven without even messing with .htaccess. I tried
Code:
http://example.com
(with codeigniter 2.1) it gave me the default controller. tried
Code:
http://example.com/index.php/second_controller
and it showed me the 404 ERROR. Ok so I guess codeigniter 2.1.0 doesn't work. To prove that. Copied that same code to a server that I have that runs on Debian 6 with Apache 2.1.16. EVERYTHING WORKED FINE.
http://debian_server_example.com/index.p...controller showed the second controller.?????. Just to test things more, went to a server with ubuntu 9.04 and tried it there. WORKED AGAIN. And to be on the safe side, went even further and put it on ubuntu 8.04 (which is pretty much ancient by now) . Worked fine there too.

Played a bit on the forum and google. Found some people having similar issues, but nobody answered them. Some of the suggestions in the answers were to play with the
Code:
$config['uri_protocol'] = 'AUTO';
and try one of the other possibilities
Code:
| 'PATH_INFO'  Uses the PATH_INFO
| 'QUERY_STRING' Uses the QUERY_STRING
| 'REQUEST_URI'  Uses the REQUEST_URI
| 'ORIG_PATH_INFO' Uses the ORIG_PATH_INFO
. Tried them all . Didn't work. I don't usually have to ask on forums, cause the problems I have are usually answered somewhere on google. But this one isn't. Anyone have any ideas? Thanks in advance.


Messages In This Thread
Apache 2.2.10 PHP 5.3.6 UBUNTU 11.10 and Codeigniter 2.1.0 - by El Forum - 02-16-2012, 10:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB