views:

22

answers:

3

Hi All,

Basically i developed my app on a localhost wamp server with PHP 5. ON uploading to the actual host i notice that

  1. The server is running php 4.4.9
  2. Everytime i upload my .htaccess file, the server removes it completely.. seems to not be allowed
  3. When i test out the set all i get is a 404 page not found

Any help on how to make it work on this PHP 4 server?


I did a test with CI 1.7.2, default installation.. works on my local server but when uploaded does not work, does this mean that the server does not support it?

A: 

I'm sure this isn't what you want to here, but get a new server. Here are the reasons why:

  1. PHP 4 is no longer well supported. It's insecure.
  2. If the server is removing .htaccess files, they are also unsupported on that server, giving you one more reason to move.
  3. Code Igniter runs best with PHP 5 and with an .htaccess file.

The gist of this is you are going to have to hack your code back into the dark ages to get this to work, and then you will still have pretty URL issues and overall system instability. If you can make the switch, do.

Joe Mills
A: 

If you cannot use .htaccess files with CodeIgniter, in system/application/config/config.php there is a configuration key called index_page. You need to set that to whatever page you have bootstrapping CodeIgniter (usually /index.php)

Then, make sure all your links that get routed through CI either target index.php/controller/action/params... or utilize the URL helper (with site_url or anchor) to automatically put in the index.php

Joe Mills is exactly right in his answer, though. CI works best with PHP 5 and .htaccess.

See CI URLs and CI URL Helper for documentation.

Austin Hyde
Hi Austin, i've tried this but it doesn't work, i get a browser 404 when i do this.
Rasiel
Can't see the comment here, but in my "recent responses" page was a comment you posted with a link. Visiting the link resulted in a browser 404, but changing the request to just index.php results in no error, but no page content whatsoever. This is usually indicative of a fatal error in PHP, and errors are not set to display. Check that you have errors set to display at the appropriate level, and if that doesn't work, check through your code for missing semicolons, braces, parentheses, etc, especially in your index controller and config files.
Austin Hyde
A: 

Well i found out how to fix several things

  1. The issue with .htaccess would be to just not use modrewrite as such i put "query_string" option in my path variavable and this works.
  2. The other issue, which was the major issue was that i was using Datamapper library which is a php 5 only library.
Rasiel