Drupal 7配置错误与Postgresql在Mac OS 10.6.5 [英] Drupal 7 configuration error with Postgresql in Mac OS 10.6.5

查看:173
本文介绍了Drupal 7配置错误与Postgresql在Mac OS 10.6.5的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Postgres配置Drupal 7。在数据库设置步骤中,我收到以下错误。

I am trying to configure Drupal 7 with Postgres. At the database setup step, I get the following error.

警告:PDO :: _ construct():[2002]目录(尝试通过unix:///var/mysql/mysql.sock连接)在DatabaseConnection - > _construct()(/ Users / shamod / Sites / drupal / 7 / includes / database / database的第300行。公司)。
为了使Drupal工作,并继续安装过程,您必须解决下面报告的所有问题。有关配置数据库服务器的更多帮助,请参阅安装手册。如果您不确定这是什么意思,您应该联系您的托管服务提供商。
无法连接到数据库服务器。服务器报告以下消息:SQLSTATE [HY000] [2002]没有这样的文件或目录。
数据库服务器是否运行?
数据库是否存在,并输入正确的数据库名称?
您输入的用户名和密码是否正确?
您是否输入正确的数据库主机名?

Warning: PDO::_construct(): [2002] No such file or directory (trying to connect via unix:///var/mysql/mysql.sock) in DatabaseConnection->_construct() (line 300 of /Users/shamod/Sites/drupal/7/includes/database/database.inc). In order for Drupal to work, and to continue with the installation process, you must resolve all issues reported below. For more help with configuring your database server, see the installation handbook. If you are unsure what any of this means you should probably contact your hosting provider. Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] No such file or directory. Is the database server running? Does the database exist, and have you entered the correct database name? Have you entered the correct username and password? Have you entered the correct database hostname?

注意:我正在尝试连接到Postgresql,但在var / mysql / mysql上失败。袜子错误。我已经在Postgresql的settings.php中设置了数据库连接字符串。它仍然不起作用。

NOTE: I am trying to connect to Postgresql but it fails on var/mysql/mysql.sock error. I have setup the database connection string in settings.php for Postgresql. It still does not work.

任何想法?

推荐答案

在尝试使用网络安装程序时自己反对此错误 - 可能会出现类似的问题。

Just came up against this error myself when trying to use the web installer - might come down to a similar issue.

在安装页面上,我没有给出使用选项Postgres驱动,所以我假设我需要使用Mysql(或其他)选项。然而,看起来像Drupal安装脚本检查哪些数据库驱动程序被编译成PHP,只提供可用的 - 我的系统默认没有安装php-pgsql。

On the install page I wasn't given an option to use Postgres driver so I assumed I needed to use the "Mysql (or other)" option. However, looks like the Drupal install script checks which database drivers are compiled into PHP and only offers you what is available - my system didn't have php-pgsql installed by default.

所以我需要首先安装postgresql驱动程序到PHP,然后重新加载apache,然后重新安装。

So I needed to install the postgresql drivers to PHP first, reload apache then try the install again.

在CentOS-5上:

On CentOS-5:

sudo yum install php-pgsql
sudo service httpd restart

然后重新加载安装页面,一切正常。

Then reload the install page and all worked fine.

这篇关于Drupal 7配置错误与Postgresql在Mac OS 10.6.5的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆