问题
In phpinfo()
, under the pgsql
section, SSL support
is currently disabled:
How can I enable it?
回答1:
This is about SSL support of Pgsql really.
The library libpq is probably not compiled with SSL support. Have you built the package of pgsql and/or libpg yourself? If so, you can enable it by compiling with the option --with-openssl
If you did not compile it yourself, try to find a package with SSL built in.
回答2:
First, you need to determine “How your current PostgreSQL extension has been compiled?” (Is is compiled into the main PHP executable or Loadable extension).
Determining compilation of current PGSQL extension:
- View contents of your php.ini file
- Find a line something like ‘extension=php_pgsql.so’ (should be php_pgsql.dylib)
If you found line like this then your extension is a loadable module. If it has a semicolon in front, then your extension is into the main PHP executable.
If, it is a loadable extension then you can search on the web with the hope that someone has previously compiled the PGSQL extension with SSL Support for particular OS. If your extension is into the main PHP executable, then find OS distribution, which comes with SSL enabled.
If you’re still unable to solve your problem, then you need to build/compile the PostgreSQL extension against a version of libpq that has in turn been compiled with SSL support.
Hope it helps!
回答3:
In one of your databases (eg. the "postgres" administration db), issue show ssl;
. If it returns "off", then edit your postgresql.conf and change the line "ssl = off" to "ssl = on" and reload your config (issue "select pg_reload_conf()" as the superuser).
More details on ssl support can be found in the docs: http://www.postgresql.org/docs/9.2/static/ssl-tcp.html
来源:https://stackoverflow.com/questions/17837263/enable-ssl-support-for-pgsql