简体   繁体   中英

Internal Server Error using WAMP server

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 admin@example.com 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]

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.

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.

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM