CodeIgniter Forums
How can I use CodeIgnitor with an index.php4 file? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: How can I use CodeIgnitor with an index.php4 file? (/showthread.php?tid=2626)



How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
If you want to run CodeIgnitor through an index.php4 file, do you have to change all the other .php files in CI .php4?

I've got a server with PHP5 as the default, but I need to run a CI application that was developed with PHP4, so I'm trying run it through an index.php4 file that works in combination with my .htaccess file.

Code:
AddType application/x-httpd-fastphp .php4
Action application/x-httpd-fastphp /cgi-bin/php-cgi

PHP4 has been compliled and configured correctly. I've tested with other .php4 files with phpinfo().

I tried changing the index.php reference to index.php4 in the config file, but it seems now I'm just going down a path of renaming files as I run into "File not found" warnings. It started with CodeIgnitor.php, then Common.php, then config.php.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]coolfactor[/eluser]
Why are you using .php4 for the extension? Just curious.

You shouldn't need to change all your php files, just the index.php file would need to be changed, as that is the only one loaded directly by Apache for all pages on your site. The rest are just included, so the extension on them is irrelevant from Apache's perspective.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]coolfactor[/eluser]
And leave your EXT setting in index.php as ".php". Don't change it to ".php4".

Correction..... set it to ".php". Replace the automatic code being used to set it.

Code:
define('EXT', '.php');



How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
Yeah, it didn't work when I just tried changing index.php file to index.php4. That's when I ran into all "File not found" warnings on the other .php files.

But you ask a good question. Why can't I just add another directive to the .htaccess file to fire off php4 for .php files. I've an admin guy who helped me configure PHP 4 and this is what I started with.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Derek Jones[/eluser]
Wouldn't it be better to just let PHP 5 run it? It shouldn't take much work (if any at all, depending on the coding practices used) to make sure the PHP 4 application works in a PHP 5 environment.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
Yeah, it would be better to run 5, but this particular application just doesn't work. It's coded heavily with PHP4 methods, and we have just a couple weeks to get it up and running.

I added to my .htaccess file:

Code:
AddType application/x-httpd-fastphp .php

Tried a phpinfo.php page in my CI folder and it works fine ... displays 4.4.2, as it should, but when I try to see the default Welcome Message for CI I receive a 404 Page Not Found error.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
Yeah, so my issue now is this .htaccess file. When I remove it, CI finds the default Welcome Message, no problem. But with the .htaccess file, CI just chokes with the 404 error.

Code:
AddType application/x-httpd-fastphp .php
Action application/x-httpd-fastphp /cgi-bin/php-cgi

I've been looking through a lot of threads here on the forums on .htaccess and 404s, but they tend to deal with the Rewrite rules. At this point, I can live with the index.php in the URL. I just want to see a basic controller with PHP4 running.


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
Obviously, my .htaccess file suggests I'm handling PHP4 with FastCGI. I know there's a bunch of threads on this throughout the forums [and I'll start pouring through them], but anyone have any first-hand suggestions or ideas?


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-15-2007

[eluser]Todd S[/eluser]
Getting closer ... came across a thread which lead me to modify my php.ini file with:

cgi.fix_pathinfo = 1

http://ellislab.com/forums/viewthread/52295/

I can now see CI running with PHP4 under FastCGI, but only when I call specifically index.php?/


How can I use CodeIgnitor with an index.php4 file? - El Forum - 08-16-2007

[eluser]Unknown[/eluser]
sorry to saw that i can not able to install the codeigniter can you help me to use this framework

instruct me to install this to my system