views:

330

answers:

3

I started working on a project in the mid. We are using Zend Framework, PHP, MySql, Ajax, jQuery and jSon on Ubuntu. It was working on ubuntu.

Now I switched to Windows. I installed Wamp, Eclipse and create a host(test.dev) on windows for my project. But when start the project by test.dev. it give me the following error on browser windows:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

then i deleted the public/.htaccess file and try again. This time no error is displayed but browser page is blank. I checked the firebug(mozilla browser) and there is no response in consol.

My .htaccess file is like that:

SetEnv APPLICATION_ENV development

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Can someone tell me that what problem may be and how to solve this. If you need some other information then tell me what type of information required for you to solve this.

Thanks

+1  A: 

The .htaccess file looks fine. My bet is the mod_rewrite module is not activated in your local Apache. Check out your httpd.conf file..

Take a look into Apache's error.log file first. It will give you detailed information about the 500 error and its cause.

Pekka
Thanks. your answer is also very helpful but answer with more detail at the moment is accepted.
Awan
+3  A: 

A 500 - Internal Server Error is often caused by something incorrect in a configuration file.

Considering it works (i.e. no error) when you delete the .htaccess file, there's probably something in it that causes troubles.


As a first idea (as there is not much in yours, except rewrite rules), are you sure that mod_rewrite is enabled ?
You can check this in your Apache configuration : there should be a line like this one :

LoadModule rewrite_module modules/mod_rewrite.so


If this doesn't help, do you have any error message in Apache's error_log file ?

Pascal MARTIN
Thanks. My site is working now by enabling ( LoadModule rewrite_module modules/mod_rewrite.so ) in httpd.conf. But now I have problem on ajax links. Anyway ajax problem is another issue and I will ask about it in another question if not solved.
Awan
You're welcome :-) ;;; as you said, Ajax problem is another issue, which means that asking another question, focused on that specific problem and describing it more precisely, should get you more help :-)
Pascal MARTIN
Ok. I will definitely ask other question for this if I will be unable to solve this. But first I will try to solve it myself :)
Awan
OK :-) Have fun !
Pascal MARTIN
+1  A: 

What Pekka and Pascal said is right, but you can take a look to if mod_env module is loaded in your Apache configuration so you can use the SetEnv directive.

I have this same problem when I put an application in production. To my surprise, this module is not enabled in some installations.

Luiz Damim