Internal Server Error using WAMP server
Asked Answered
T

4

8

I've created a MVC application using php, but when I try to access the urls it gives me "The server encountered an internal error"

When I check the log it gives me :

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at [email protected] to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.

my .htaccess file Code:

Options-MultiViews
RewriteEngine On

RewriteBase/MVC/public

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f


RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
Tremendous answered 29/12, 2014 at 7:14 Comment(9)
Make sure mod_rewrite is ON in your apache settingOleander
Which log? Have you checked the event log in Windows and the errorlog in Apache?Gobbler
@ amit how to On mod_rewrite am new in phpTremendous
@anubhava not workingTremendous
Check your Apache error.log for actual error message.Greylag
@Greylag in my Apache error.log Message C:/wamp/www/MVC/app/.htaccess: Invalid command 'Options-Indexes', perhaps misspelled or defined by a module not included in the server configurationTremendous
You need to always have a space after Options word. So it should be Options -IndexesGreylag
I have this what it is C:/wamp/www/MVC/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration can any one helpTremendous
I got Answer Thanks For Help guysTremendous
O
2

To enable mod_rewrite, went through the below steps:

1. Find and open the file .http.conf. This will be located in your Apache install folder.
2. Make a backup of http.conf which you can restore from, if anything were to go wrong
3. Find the line #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash ‘#’
4. Locate the block within the directory tags as indicated below and change to:
<directory />
Options All
AllowOverride All
</directory>
5. Find any additional occurrences of the line “AllowOverride None” and change it to “AllowOverride All”.
6.Finally, restart apache server and your browser. The .htaccess rewriting should now be working for any local website.
Oleander answered 29/12, 2014 at 7:22 Comment(3)
C:/wamp/www/MVC/app/.htaccess: Invalid command 'Options-Indexes', perhaps misspelled or defined by a module not included in the server configurationTremendous
Also make sure mod_rewrite is ON. create test.php file with code <?php phpinfo(); ?> execute it and see mod_rewirite is on or offOleander
my apache version is 2.4.9Tremendous
O
5

This problem is faced in Wampserver when the essential modules are not enable

You can Enable them with:

  • Left click on Wampsever icon

  • Go to APACHE -> APACHE MODULES

  • scroll down and find "rewrite_module" and "headers_module"

  • Then mark them check

It will restart automatically. Done.

enter image description here

Obmutescence answered 8/6, 2021 at 14:23 Comment(0)
C
4

This problem comes due to wampserver using local.

You can change it with:

  • Left click on wampsever

  • Go to APACHE -> APACHE MODULES

  • scroll down and find "rewrite_module"

  • Then mark it check

It will restart automatically. All set.

Conlon answered 15/2, 2017 at 6:24 Comment(2)
@HebeleHododo I have tried it but its not working. Still facing the same errorObmutescence
@HebeleHododo, try stop all services and restart againConlon
O
2

To enable mod_rewrite, went through the below steps:

1. Find and open the file .http.conf. This will be located in your Apache install folder.
2. Make a backup of http.conf which you can restore from, if anything were to go wrong
3. Find the line #LoadModule rewrite_module modules/mod_rewrite.so and remove the hash ‘#’
4. Locate the block within the directory tags as indicated below and change to:
<directory />
Options All
AllowOverride All
</directory>
5. Find any additional occurrences of the line “AllowOverride None” and change it to “AllowOverride All”.
6.Finally, restart apache server and your browser. The .htaccess rewriting should now be working for any local website.
Oleander answered 29/12, 2014 at 7:22 Comment(3)
C:/wamp/www/MVC/app/.htaccess: Invalid command 'Options-Indexes', perhaps misspelled or defined by a module not included in the server configurationTremendous
Also make sure mod_rewrite is ON. create test.php file with code <?php phpinfo(); ?> execute it and see mod_rewirite is on or offOleander
my apache version is 2.4.9Tremendous
Q
0

You can change it with:

  • Left click on wampsever

    Go to APACHE -> APACHE MODULES

    scroll down and find "rewrite_module"

    Then mark it check

Quinquereme answered 29/7 at 18:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.