PHP:Internal Server Error using WAMP (at startup)
Asked Answered
H

11

20

i had a problem wth php.It display error like below. It work well in other computer, but when i tried to run it in another computer it display error like below. I think i had a problem with my wampserver 2.0 configuration.

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, webmaster@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.

Hodeida answered 22/8, 2010 at 4:47 Comment(1)
Did you check the server log like it tells you to? All that error says is somethings broke, and check the log for more details.Insectarium
P
40

Its due to mod_rewrite. WAMP had commented this option by default.

You need to go to WAMP icon in notification area, Apache, httpd.config

search for mod_rewrite, and uncomment it.

After that RESTART WAMP AND YOU ARE DONE!

Plosion answered 24/1, 2012 at 20:11 Comment(2)
My mod_rewrite is unmarked and i get the same error. Any thoughts on how to solve?Staceestacey
mod_rewrite was already uncommented for me, and the logs show nothing.Narrate
L
6

This is because mod_rewrite module is disabled in your Apache's configuration:

  1. If your website is hosted at local machine you can simply open httpd.conf in Apaches's conf folder and search for "mod_rewrite". If mod_rewrite line is having a # in front of it, just remove this #, save file, and restart Apache.

  2. If your website is hosted at shared hosting server then you may not have privileges to make changes in Apache's configuration. So you have to ask your hosting administrator to enable mod_rewrite module for you. This is already enabled by almost every shared hosting provider.

Luxuriant answered 25/12, 2012 at 12:37 Comment(1)
mod_rewrite was already uncommented for me, and the logs show nothing.Narrate
T
5

I had this problem but the rewrite module was already enabled. There is a header command in the shops .htaccess file that was causing it. Enabling the headers_module in apache fixed it. Thought this might help someone.

Thornberry answered 26/8, 2019 at 12:42 Comment(1)
What do you mean with "shops"?Conglomerate
K
4

This is mod_rewrite problem, just enable mod_rewrite in your apache server or tell your website hosting company to enable it for you. This will make your site work.

Kampmann answered 3/5, 2011 at 11:53 Comment(0)
C
3

Although everyone says the same, I want to add the answer based on some information I collected from this site.

This kind of error is happened if apache mod_rewrite feature of your server is not enabled. By default WAMP server does not load this Apache Mod Rewrite module. It is disabled by default. You have to enable a this option to load this module. There is line in WAMP Apache configuration file about this but that is commented by default. To enable this mod_rewrite feature follow this instruction.

  • Look at Wamp icon in notification area on system tray (near Clock in Windows OS)
  • Click on the WAMP icon
  • Go to Apache>httpd.config
  • A Configuration file will be opened in “Note Pad” or your default text editor.
  • Search the text “mod_rewrite” , you will find a line “#LoadModule rewrite_module modules/mod_rewrite.so“
  • Uncomment this line by removing the Hash “#” from the beginning of the line.
  • Save the file Restart WAMP Server by clicking “Restart All Services” from WAMP menu. YOU ARE DONE!
Carminacarminative answered 8/12, 2014 at 8:50 Comment(0)
P
2

For anyone finding this question, and mod_rewrite is ALREADY enabled...

Check that WAMP hasn't put an unwanted .htaccess file in the root of the C:\ drive.

This happened to me, I think after experimenting with different settings in the httpd.conf file.

After I'd reverted my httpd.conf settings I started seeing the Internal Server Error. Deleting the .htaccess file fixed the problem.

Permission answered 14/5, 2019 at 16:4 Comment(1)
This exactly happened with me. I actually had .htaccess file in my asset folder and wonder why this is not working. After deleting everythings works fine.Meurer
A
0

Definitely do what hunzaboy suggests first. Then if you're still getting the error, I found that one of my directives in my httpd-vhosts.conf file was causing the same error to persist even after taking his advice. I commented the line: "Require all granted" (which worked using a newer version of Apache) and everything was fine.

Alkahest answered 20/5, 2013 at 5:59 Comment(0)
D
0

this must be commented in: LoadModule rewrite_module modules/mod_rewrite.so

Disjoined answered 28/6, 2013 at 22:54 Comment(0)
N
0

If you find mod_rewrite already uncommented and still you get the same error. Go and check if the headers_module is enabled or not. For that you can follow below steps.

  1. Left click on wamp icon in the notification area.
  2. Hover to Apache
  3. Hover to Apache Modules
  4. Click on headers_module

Now wait for wamp server to restart and check If it works.

Nafis answered 20/6, 2022 at 6:5 Comment(0)
K
0

I had same issue, but the problem wasn't on all my websites, it was only on one.

So just make sure you don't have following code in your .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
Killerdiller answered 2/12, 2022 at 17:59 Comment(0)
A
0

@MikMark I just found solution which I have already faced this problem. I also have modules/mod_rewrite.so file is uncommented. So I found below solution.

  • Go to \wamp\bin\apache\apache2.4.54.2\conf\httpd.conf
  • Search for a rewrite_module modules/mod_rewrite.so
  • Comment this line with prefix '#'

This might be helpful for you.

Autotransformer answered 19/12, 2023 at 7:35 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.