我正在尝试在Amazon EC2实例上创建wordpress博客。amazon base映像已经安装了apache和php。我在我的用户目录中手动安装了MySQL。我可以从linux命令行登录MySQL数据库。但是我无法从php连接到MySQL数据库。我测试的场景如下。我有一个通过apache托管的php文件。当我在浏览器中打开php文件时;MySQL连接失败。以下是浏览器中的消息
Error establishing a database connection
This either means that the username and password information in your wp-config.php file is incorrect or we can\'t contact the database server at xxx.xxx.compute-1.amazonaws.com:port. This could mean your host\'s database server is down.
Are you sure you have the correct username and password?
Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?
我的问题是。在已经安装php的情况下手动安装MySQL是否不正确?我的意思是,建议先用mysql编译安装php吗?
EDIT
php/apache已经预装在我从amazon实例化的机器中。它的操作系统是amazon linux。
rpm -qa |grep -i httpd
httpd-tools-2.2.16-1.0.amzn1.x86_64
httpd-2.2.16-1.0.amzn1.x86_64
rpm -qa |grep -i php
php-common-5.3.5-1.11.13.amzn1.x86_64
php-5.3.5-1.11.13.amzn1.x86_64
php-cli-5.3.5-1.11.13.amzn1.x86_64
谢谢。yum安装mysql服务器有点帮助。因此,首先我删除了手动安装;然后yum安装mysql服务器;另外,yum安装-y php-mysql
EDIT 2
我又调试了一点。我发现,如果我将wordpress目录放在apache根目录下,并且不进行端口转发(没有代理和proxyreverse),那么我就能够从WP安装文件连接到DB。但是,如果我将WP文件放在JBoss下,并从apache向JBoss进行端口转发,那么从JBoss内部,我无法通过WP php文件连接到MySQL DB。所以问题出在JBoss的Caucho Quercus部分的某个地方。有什么建议吗?谢谢