这似乎很奇怪,我安装了apache2
、php5
、phpmyadmin
、mysql-server
。
我创建了一个代码为的文件
<?php
phpinfo();
?>
然后我的web服务器输出与代码字符串相同。它没有输出任何php配置。
我使用过谷歌云平台,数字海洋。。AmazonEC2是个新手,但由于这台机器只是一个linux,它应该可以正常工作,但事实并非如此。
编辑:
当我在EC2实例命令行上运行这个命令$php info.php
时,它显示了phpinfo();的完整输出,但它没有显示在我的浏览器上。
输出:sudo apachectl -M
core_module (static)
so_module (static)
watchdog_module (static)
http_module (static)
log_config_module (static)
logio_module (static)
version_module (static)
unixd_module (static)
access_compat_module (shared)
alias_module (shared)
auth_basic_module (shared)
authn_core_module (shared)
authn_file_module (shared)
authz_core_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
filter_module (shared)
mime_module (shared)
mpm_event_module (shared)
negotiation_module (shared)
setenvif_module (shared)
status_module (shared)
我刚刚安装了libapache2-mod-php5
,并通过sudo a2enmod php5
启用了php5模块
一切都开始奏效了!:)