Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/266.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php .htaccess在本地主机上出现500错误_Php_Apache_.htaccess - Fatal编程技术网

Php .htaccess在本地主机上出现500错误

Php .htaccess在本地主机上出现500错误,php,apache,.htaccess,Php,Apache,.htaccess,我是MVC框架的初学者。我正试图根据教程创建一个我自己的 他们提供的.htaccess文件包含: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA, L] i get 500服务器错误:服务器遇到内部错误,无法完成您

我是MVC框架的初学者。我正试图根据教程创建一个我自己的

他们提供的.htaccess文件包含:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]
i get 500服务器错误:服务器遇到内部错误,无法完成您的请求。服务器过载或CGI脚本中存在错误

我检查了httpd.conf以检查mode_rewrite是否未被注释。有人能帮我吗?我在Ubuntu 12.04上使用LAMPP

RewriteRule ^(.+)$ index.php?url=$1 [QSA, L]
改为:

RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
注,“[QSA,L]”与[QSA,L]


复制了错误,删除了空间,工作正常)。我正在使用WAMP。

请尝试cjriii的答案,如果这不起作用,请检查httpd.conf文件中的AllowOverride变量,并确保它显示全部而不是全部。当我第一次开始使用mod_rewrite时,这也让我大吃一惊。

检查您的Apache错误日志。它可能在
/var/log/apache/
中,正在拍摄。。。Apache模块
mod_rewrite
在您的服务器上被禁用mod_rewrite未被禁用它前面没有#在httpd.conf上,如何启用它如果它被启用,请转到其他地方。正如ascii时间所说,使用ubuntu检查日志SIM,因此cd/var/log/apache没有找到任何文件。谢谢你,我现在没有收到错误,但由于某种原因,我的引导程序没有看到$\u get['url'],它显示未定义的索引。更不用说我在php文件中有错误。它是控制器的Index.php,在我的引导程序中,它在寻找小写的Index.php,所以我只是把它做成首字母大写,现在它可以工作了。非常感谢。