.htaccess和php文件

0 php apache .htaccess

所以,当我输入包含以下内容的.htaccess文件时:

# Use PHP5 php.ini as default
AddHandler application/x-httpd-php5 .php

AcceptPathInfo On

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [L,QSA]
Run Code Online (Sandbox Code Playgroud)

服务器尝试下载PHP文件而不是执行它.当我删除.htaccess文件时,一切正常,PHP文件执行.

Phi*_*hil 5

我将删除该AddHandler指令.将此保留给服务器配置.

其他一切看起来都不错.