CodeIgniter is a PHP framework, that supposedly does not have the bloat of the other PHP frameworks (Zend Framework was one that I used, and it was a pain to navigate all that bloat).
I decided on CodeIgniter because I had read about it before at a web development blog (SitePoint if I remember correctly), and since IceFrog uses it, it can’t be that bad right? =P
All was going well as I setup a new virtual host in nginx and I downloaded CodeIgniter to my server and editted the config files as it said in the instructions manual: http://codeigniter.com/user_guide/installation/index.html
However, once I got to the Hello World example (http://codeigniter.com/user_guide/general/controllers.html#hello), I noticed that when I visited the URL for it, I still got shown the welcome page, which was unexpected. I tried removing the welcome.php and was then left with a 404 error. I took about 2 minutes thinking about it, and thought that it might’ve been because the PATH_INFO (the bit after .php/) isn’t getting through to the script, so I ran phpinfo with some PATH_INFO passed to it (http://host.cryptwizard.info/phpinfo.php/aoeu), and sure enough, there was no _SERVER["PATH_INFO"] under the PHP Variables section. Knowing the problem, I knew that finding the solution (or lack thereof) would not be hard (trust me, it’s always finding the problem that’s hard, not the solution).
So with my trusty friend, I found this useful mailing list post, straight from the creator of nginx:
> Dear All,
>
> Im a System Admin from Indonesia.
> I have a little trouble with Engine-X (nginx).
> My server can recognize PHP & FCGI well, but a trouble appear when I use
> a FuseBox frame work in my server.
> I assume that the troubles are here:
> ~ when server access a page like this:
> http://jkt6.detiksport.com/raket/index.php/home.read/tahun/2007/bulan/12/tgl/17/ti \
> me/235133/idnews/868421/idkanal/79
> Engine-X will parse that as folder (identified by slash (/)), but that
> doesn’t really a folder. Those are a fuseBox parsing methode.
> I run this application in Apache, and everything going well.
>
> What should I do ?
>
location ~ \.php($|/) {
set $script $uri;
set $path_info “”;
if ($uri ~ “^(.+\.php)(/.+)”) {
set $script $1;
set $path_info $2;
}
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME
/data/labdetiksport/site/sport$script;
fastcgi_param PATH_INFO $path_info;
I adjusted my nginx.conf per that post and viola, my “Hello, World!” worked:
http://host.cryptwizard.info/blog/
Now time to get onto some real work…