6
votes

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]
3
Make sure mod_rewrite is ON in your apache settingamit
Which log? Have you checked the event log in Windows and the errorlog in Apache?Adam Plocher
@ amit how to On mod_rewrite am new in phpKuMaR
@anubhava not workingKuMaR
Check your Apache error.log for actual error message.anubhava

3 Answers

2
votes

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.
4
votes

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.

0
votes

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