我不明白为什么。他没有执行 php 文件,而是为我提供下载服务。
在下载的文件中有php源。
我的测试文件很简单,叫做 info.php
<?php
phpinfo();
我的虚拟主机:
<VirtualHost some_ip:80>
DocumentRoot /var/www/vhosts/my_vhost/htdocs
ServerName www.my_vhost.com
<Directory /var/www/vhosts/my_vhost/htdocs/>
Options All -MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ErrorLog /var/www/vhosts/my_vhost/logs/error.log
LogLevel warn
CustomLog /var/www/vhosts/my_vhost/logs/access.log combined
</VirtualHost>
在 apache2 conf 我有一行:
AddType application/x-httpd-php .php
启用 Apache 的模块:
apache2ctl -M
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
actions_module (shared)
alias_module (shared)
auth_basic_module (shared)
auth_digest_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
bw_module (shared)
cgi_module (shared)
dav_module (shared)
dav_fs_module (shared)
dav_lock_module (shared)
dav_svn_module (shared)
authz_svn_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
fcgid_module (shared)
include_module (shared)
mime_module (shared)
negotiation_module (shared)
perl_module (shared)
php5_module (shared)
python_module (shared)
reqtimeout_module (shared)
rewrite_module (shared)
setenvif_module (shared)
ssl_module (shared)
status_module (shared)
suexec_module (shared)
userdir_module (shared)
wsgi_module (shared)
Syntax OK
我必须尝试调试和解决这个问题吗?
我也安装了 phpmyadmin,它工作正常。