Zend: .htaccess is not working on windows now how to continue my project?
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开发者_Python百科) 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
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 ?
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.
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.
精彩评论