CodeIgniter in CGI Mode?

#1
[eluser]Unknown[/eluser]
Hi, I am an intern web developer, with rookie php/apache experience. I am coding some sites for a university which uses php in CGI mode only (I'm required to add the php location on the first line, and use .cgi extensions for scripts.)

Is there any way to use Code Igniter in cgi mode? Would it be as simple as editing some of the file names and adding the php location to them?

Just thought I would ask to see if this is an issue before I dive into CI.

Thank you,
Jason

#2
[eluser]Valdemar[/eluser]
That's really a bad way to have php installed :-) I'm unsure why your university would keep it like that .. you can still use php in cgi mode without forcing the file extension and having to add the php binary executable (what was the name .. shebang?) in the first line.

There might be a simple solution to your problem if you have the permissions (and also if you are using Apache) to override the apache php handler. In short, you will need to edit your .htaccess and add something like:

AddHandler application/x-httpd-php .php .php3 .php4 .php5 .phtml

This will instruct Apache to parse any file with .php/.php3/.php4/.php5 or .phtml as a php script.

#3
[eluser]Unknown[/eluser]
Yes, it does make things difficult Undecided They say its for security since most of the sites are all hosted on one machine, and one apache instance. Perhaps the shebang and extensions were default requirements, and they never bothered (or knew how) to change them.

I will give that AddHandler a try, although I have found that they (university server admins) have greatly limited what I can do in my htacess file.

Anything else I should be aware of? They do have a site that uses drupal (which "requires?" php to be installed as module), so hopefully I can get CI going.

Thanks for the help!


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.