CodeIgniter 500 Internal Server Error

前端 未结 11 776
忘掉有多难
忘掉有多难 2020-12-11 16:10

I downloaded a PHP script written using CodeIgniter. when I run it from the localhost, on going to the admin folder, it shows localhost again. Also when running from my web

相关标签:
11条回答
  • 2020-12-11 16:33

    This probably isn't relevant any more to this thread, but hopefully helpful to somebody. I've had 500 errors for the past hour as I had a controller return an array not supported by the php version ran on my (crappy) server. Seems trivial but had the hallmarks of a codeigniter error.

    I had to use:

    class emck_model extends CI_Model {
    
        public function getTiles(){
    
            return array(...);
    
        }
    
    } 
    

    Instead of

    class emck_model extends CI_Model {
    
        public function getTiles(){
    
            return [...];
    
        }
    
    }
    

    Cheers

    0 讨论(0)
  • 2020-12-11 16:36

    Whenever I run CodeIgniter in a sub directory I set the RewriteBase to it. Try setting it as /myproj/ instead of /.

    0 讨论(0)
  • 2020-12-11 16:38

    Just in case somebody else stumbles across this problem, I inherited an older CodeIgniter project and had a lot of trouble getting it to install.

    I wasted a ton of time trying to create a local installation of the site and tried everything. In the end, the solution was simple.

    The problem is that older CodeIgniter versions (like 1.7 and below), don't work with PHP 5.3. The solution is to switch to PHP 5.2 or something older.

    0 讨论(0)
  • 2020-12-11 16:39

    if The wampserver Version 2.5 then change apache configuration as

    httpd.conf (apache configuration file): From

    #LoadModule rewrite_module modules/mod_rewrite.so** 
    

    To ,delete the #

    LoadModule rewrite_module modules/mod_rewrite.so** 
    

    this working fine to me

    0 讨论(0)
  • 2020-12-11 16:42

    Try this to your .htaccess file:

    <IfModule mod_rewrite.c>
      RewriteEngine On
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule ^(.*)$ index.php?/$1 [L]
    </IfModule >
    
    0 讨论(0)
  • 2020-12-11 16:44

    Make sure your root index.php file has the correct permission, its permission must be 0755 or 0644

    0 讨论(0)
提交回复
热议问题