0

I have made a web app using CodeIgniter 2.1.3 with PHP 5.4.24 and EasyPHP 14.1 on WAMP. Now, I want to transfer my server on Ubuntu 12.04 LTS using this LAMP tutorial. Everything works fine except my web app stops on working. It can parse simple scripts though like when creating new CI file. I can't figure out what's wrong.

Here's what the log says:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol.

HTTP/1.0 500 Internal Server Error 15ms

Hard Spocker
  • 765
  • 11
  • 32

1 Answers1

1

There may be errors on your page. You can display them by adding the following lines to the top your main index file, be it index.php or backend.php

error_reporting(E_ALL);
ini_set('display_errors', 1);

Also, check if you have enabled mod_rewrite in your apache config.

aravindanve
  • 979
  • 7
  • 14
  • when it was on my WAMP server, it has no errors. Ill try to check if there is on LAMP. By the way, why do I need to enable mod_rewrite and how? – Hard Spocker Sep 15 '15 at 05:41
  • 1
    `mod_rewrite` is an apache module that is used by codeigniter to route your urls. And the `.htaccess` file in your project directory usually contains directives like `RewriteEngine On`. This needs `mod_rewrite` to work. You can check if its enabled by typing `apachectl -t -D DUMP_MODULES | grep rewrite_module` in your shell. You should see something like `rewrite_module (shared)`. if not, then enable it. You can see how to do that here [http://stackoverflow.com/a/5758551/4274918](http://stackoverflow.com/a/5758551/4274918) – aravindanve Sep 15 '15 at 05:57
  • hey, also ive noticed my .htaccess files are missing when uploaded to my lamp server. where can i find or let them be visible again? – Hard Spocker Sep 15 '15 at 06:08
  • i can see that my `mod_rewrite` is already enabled, checked it and displayed `rewrite_module (shared)` thank you for that! but, still not fixing my problem – Hard Spocker Sep 15 '15 at 06:11
  • This error may be caused by a lot of things, from improper file permissions to parse errors. Try looking at `/var/log/apache2/access.log` and `/var/log/apache2/error.log` for more information. And did you try displaying all errors, did you find anything there? – aravindanve Sep 15 '15 at 06:44
  • Regarding `.htaccess`, if you are new to linux, files prefixed with a dot `.` are hidden. to show them, `cd` to your project directory in the terminal and do `ls -a -l` to show all files. – aravindanve Sep 15 '15 at 06:46
  • somehow i got to stop showing encoding error by uncommenting AddDefaultCharset UTF-8 at /etc/apache2/conf.d but im still getting HTTP/1.0 500 Internal Server Error – Hard Spocker Sep 15 '15 at 08:34