首页 > 解决方案 > 在 .htaccess 中更改 PHP 版本后出现内部服务器错误

问题描述

我正在开发 laravel 5.6 版。我的服务器的应用程序版本如下:

阿帕奇:阿帕奇/2.2.27

PHP: 5.4.27

MySQL:5.5.59

我无权在服务器中升级 PHP 版本。因此,我决定将这行代码添加到 public_html 文件夹内的 .htaccess 文件中。

AddHandler application/x-httpd-php70 .php

所以我的 .htaccess 文件看起来像这样

<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
    Options -MultiViews -Indexes
</IfModule>

RewriteEngine On
AddHandler application/x-httpd-php70 .php


# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]

# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]

但它没有升级 PHP 版本,而是给了我“500 Internal Server Error”页面并下载了一个名为“download”的文件。我能做些什么来处理这个问题?谢谢你。

标签: phplaravelapache.htaccesslaravel-5.6

解决方案


推荐阅读