PHP Apache - PHP给出了内部错误

时间:2016-02-09 13:32:01

标签: apache .htaccess

基本上,即使我只是使用:

<?php 

它给我一个500内部服务器错误?虽然,在命令行上,我可以运行php index.php并且运行正常吗?

我正在使用CENTOS,我检查了日志,并得到了这个:

  

由于可能的配置错误,请求超出了10个内部重定向的限制。使用&#39; LimitInternalRecursion&#39;如有必要,增加限额。

但我不知道这是否相关?有什么想法,为什么它只是给我一个内部服务器错误,即使只是打开标签?

我的.htaccess文件:

<IfModule mod_deflate.c>
    SetOutputFilter DEFLATE
    <IfModule mod_setenvif.c>
        # Netscape 4.x has some problems...
        BrowserMatch ^Mozilla/4 gzip-only-text/html

        # Netscape 4.06-4.08 have some more problems
        BrowserMatch ^Mozilla/4\.0[678] no-gzip

        # MSIE masquerades as Netscape, but it is fine
        # BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

        # NOTE: Due to a bug in mod_setenvif up to Apache 2.0.48
        # the above regex won't work. You can use the following
        # workaround to get the desired effect:
        BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html

        # Don't compress images
        SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    </IfModule>

    <IfModule mod_headers.c>
        # Make sure proxies don't deliver the wrong content
        Header append Vary User-Agent env=!dont-vary
    </IfModule>
</IfModule>
~ 

编辑:

这是配置文件:

<VirtualHost IP:80>
    ServerName mysite
    ServerAlias wmysite
    DocumentRoot /home/path/public_html
    ServerAdmin webmaster@website.com
    UseCanonicalName Off
    ErrorLog  /usr/local/apache/error_log
    CustomLog /usr/local/apache/domlogs/website.co.uk combined
    CustomLog /usr/local/apache/domlogs/website.co.uk-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    UserDir enabled mywebsite
    <IfModule mod_suphp.c>
        suPHP_UserGroup mywebsite mywebsite
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
            SuexecUserGroup mywebsite mywebsite
        </IfModule>
    </IfModule>
    <IfModule mod_ruid2.c>
        RMode config
        RUidGid mywebsite mywebsite
    </IfModule>
    <IfModule itk.c>
        # For more information on MPM ITK, please read:
        #   http://mpm-itk.sesse.net/
        AssignUserID mywebsite mywebsite
    </IfModule>

    ScriptAlias /cgi-bin/ /home/mywebsite/public_html/cgi-bin/




    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2_2/mywebsite/mywebsite.co.uk/*.conf"
</VirtualHost>               

我已将网站替换为mywebsite

编辑2:

Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]

其他.htaccess文件

0 个答案:

没有答案