<i id='mCNbo'><tr id='mCNbo'><dt id='mCNbo'><q id='mCNbo'><span id='mCNbo'><b id='mCNbo'><form id='mCNbo'><ins id='mCNbo'></ins><ul id='mCNbo'></ul><sub id='mCNbo'></sub></form><legend id='mCNbo'></legend><bdo id='mCNbo'><pre id='mCNbo'><center id='mCNbo'></center></pre></bdo></b><th id='mCNbo'></th></span></q></dt></tr></i><div id='mCNbo'><tfoot id='mCNbo'></tfoot><dl id='mCNbo'><fieldset id='mCNbo'></fieldset></dl></div>
  • <legend id='mCNbo'><style id='mCNbo'><dir id='mCNbo'><q id='mCNbo'></q></dir></style></legend>

    <tfoot id='mCNbo'></tfoot>
    • <bdo id='mCNbo'></bdo><ul id='mCNbo'></ul>
  • <small id='mCNbo'></small><noframes id='mCNbo'>

      1. 无法使用 PHP pg_connect() 连接到 PostgreSQL

        Can#39;t Connect to PostgreSQL with PHP pg_connect()(无法使用 PHP pg_connect() 连接到 PostgreSQL)
      2. <small id='xUIGy'></small><noframes id='xUIGy'>

        <tfoot id='xUIGy'></tfoot>
          <legend id='xUIGy'><style id='xUIGy'><dir id='xUIGy'><q id='xUIGy'></q></dir></style></legend>
                <bdo id='xUIGy'></bdo><ul id='xUIGy'></ul>
                  <tbody id='xUIGy'></tbody>
                  <i id='xUIGy'><tr id='xUIGy'><dt id='xUIGy'><q id='xUIGy'><span id='xUIGy'><b id='xUIGy'><form id='xUIGy'><ins id='xUIGy'></ins><ul id='xUIGy'></ul><sub id='xUIGy'></sub></form><legend id='xUIGy'></legend><bdo id='xUIGy'><pre id='xUIGy'><center id='xUIGy'></center></pre></bdo></b><th id='xUIGy'></th></span></q></dt></tr></i><div id='xUIGy'><tfoot id='xUIGy'></tfoot><dl id='xUIGy'><fieldset id='xUIGy'></fieldset></dl></div>
                  本文介绍了无法使用 PHP pg_connect() 连接到 PostgreSQL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我刚刚意识到这个问题可能更适合 ServerFault.版主不要复制它,请把它移过来?谢谢.

                  I just realized that this question may be better suited to ServerFault. Instead of copying it, a moderator please move it over? Thanks.

                  我检查了 php-info,并且 Postgresql 扩展在那里(pg_connect() 不是未定义的).我还可以使用本地主机上的 psql 连接到 postgresql(我已经适当地编辑了我的 pg_hba.conf 文件).这是不起作用的代码:

                  I've checked php-info, and the Postgresql extension is there (pg_connect() is not undefined). I am also able to connect to postgresql using psql on localhost (I've edited my pg_hba.conf file appropriately). Here is the code that's not working:

                  <?php
                  $dbconn = pg_connect("host=localhost port=5432 dbname=mydb user=myuser password=mypass") or die('Could not connect: ' . pg_last_error());
                  ?>
                  

                  此代码只会导致浏览器中显示无法连接:".

                  This code simply results in "Could not connect: " being displayed in the browser.

                  我检查了我的 apache 日志,这是相关的错误消息:

                  I checked my apache log, and here's the relevant error message:

                  PHP Warning:  pg_connect() [<a href='function.pg-connect'>function.pg-connect</a>]: 
                  Unable to connect to PostgreSQL server: could not connect to server: Permission 
                  denied
                  	Is the server running on host &quot;localhost&quot; and accepting
                  	TCP/IP 
                  connections on port 5432?
                  

                  如何修复/调试此问题?

                  How can I fix/debug this?

                  我在 Centos 5.4 顺便说一句.

                  I'm on Centos 5.4 btw.

                  推荐答案

                  无法连接到服务器:权限被拒绝

                  could not connect to server: Permission denied

                  我在 Centos 5.4 顺便说一句.

                  I'm on Centos 5.4 btw.

                  检查 /var/log/audit/audit.log.您可能遇到了 SELinux 规则.

                  Check /var/log/audit/audit.log. Chances are that you're hitting a SELinux rule.

                  这篇关于无法使用 PHP pg_connect() 连接到 PostgreSQL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tbody id='d6H6Z'></tbody>
                  • <bdo id='d6H6Z'></bdo><ul id='d6H6Z'></ul>

                    <small id='d6H6Z'></small><noframes id='d6H6Z'>

                          1. <tfoot id='d6H6Z'></tfoot>
                            <i id='d6H6Z'><tr id='d6H6Z'><dt id='d6H6Z'><q id='d6H6Z'><span id='d6H6Z'><b id='d6H6Z'><form id='d6H6Z'><ins id='d6H6Z'></ins><ul id='d6H6Z'></ul><sub id='d6H6Z'></sub></form><legend id='d6H6Z'></legend><bdo id='d6H6Z'><pre id='d6H6Z'><center id='d6H6Z'></center></pre></bdo></b><th id='d6H6Z'></th></span></q></dt></tr></i><div id='d6H6Z'><tfoot id='d6H6Z'></tfoot><dl id='d6H6Z'><fieldset id='d6H6Z'></fieldset></dl></div>
                            <legend id='d6H6Z'><style id='d6H6Z'><dir id='d6H6Z'><q id='d6H6Z'></q></dir></style></legend>