简体   繁体   中英

CodeIgniter not working on PHP 4 server without .htaccess availability

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?

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.

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM