php - Apache 上传(提供下载)php 而不是执行它

标签 php apache fastcgi webmin

我在 Webmin 之上使用 Virtualmin 在 VPS 上配置我的网站。

一切正常,但现在我尝试创建一个新域,但是当我将文件放入其 public_html 时,它会提供要下载的 php 文件而不是执行它。如何解决这个问题

这些是我的 apache 配置(找不到任何奇怪的东西):

/etc/apache2/sites-available/testbyc.--.nu.conf

SuexecUserGroup "#1009" "#1011"
ServerName testbyc.--.nu
ServerAlias www.testbyc.--.nu
ServerAlias webmail.--.--.nu
ServerAlias admin.testbyc.--.nu
DocumentRoot /home/byc/domains/testbyc.--.nu/public_html
ErrorLog /var/log/virtualmin/testbyc.--.nu_error_log
CustomLog /var/log/virtualmin/testbyc.--.nu_access_log combined
ScriptAlias /cgi-bin/ /home/byc/domains/testbyc.--.nu/cgi-bin/
ScriptAlias /awstats/ /home/byc/domains/testbyc.--.nu/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/byc/domains/testbyc.--.nu/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch +ExecCGI
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
AddHandler fcgid-script .php
AddHandler fcgid-script .php5
FCGIWrapper /home/byc/domains/testbyc.--.nu/fcgi-bin/php5.fcgi .php
FCGIWrapper /home/byc/domains/testbyc.--.nu/fcgi-bin/php5.fcgi .php5
</Directory>
<Directory /home/byc/domains/testbyc.--.nu/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
</Directory>
RewriteEngine on
RewriteCond %{HTTP_HOST} =webmail.testbyc.--.nu
RewriteRule ^(.*) https://testbyc.--.nu:20000/ [R]
RewriteCond %{HTTP_HOST} =admin.testbyc.--.nu
RewriteRule ^(.*) https://testbyc.--.nu:10000/ [R]
php_admin_value engine Off
IPCCommTimeout 31
FcgidMaxRequestLen 1073741824
<Files awstats.pl>
AuthName "testbyc.--.nu statistics"
AuthType Basic
AuthUserFile /home/byc/domains/testbyc.--.nu/.awstats-htpasswd
require valid-user
</Files>
RedirectMatch /cgi-bin/mailman/([^/\.]*)(.cgi)?(.*) https://testbyc.--.nu:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
RedirectMatch /mailman/([^/\.]*)(.cgi)?(.*) https://testbyc.--.nu:10000/virtualmin-mailman/unauthenticated/$1.cgi$3
Alias /pipermail /var/lib/mailman/archives/public

最佳答案

尝试注释掉该行

php_admin_value 引擎关闭

这与我仍在研究的一个更大的问题有关,但最近对 Virtualmin 的更新将该行添加到一些 FCGI 相关的配置文件中,为某些用户打破了一些东西。

关于php - Apache 上传(提供下载)php 而不是执行它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14341881/

相关文章:

php - 我怎样才能替换数组中的一些东西?

php - 使用谷歌地图在我的数据库中搜索邮政编码

apache - 非常慢的 https 重定向 - 加载时间增加 10 秒

apache - 如何 : rewrite requests for images, css 和 js 到每个应用程序的不同文件夹?

c++ - 如何在 32 位 Linux Mint 中构建 64 位 FastCGI 库?

php - SSL 证书配置错误

ruby-on-rails - 由于此错误 : Option 'agents_dir' missing in file - Rails 4 + Passenger deployment,无法初始化乘客

java - PHP-CGI 帖子空

nginx - 增加504超时错误

php - 根据开始时间格式化事件