How To Install The Pdo_pgsql Module?

Keywords: PostgreSQL - Amazon Web Services - Technical issue - Other
Description:
I am trying to fix my technical problem. I need some help.
I checked bitnami document (https://docs.bitnami.com/installer/components/php/#how-to-install-the-pdopgsql-module) and command install pdo driver for postgresql.
But I can’t finish my install because of some errors.
When I tried to do make command, I got some error like this.
My envinroment is PHP 7.0.25 which is default of Bitnami WordPress For AWS Cloud.

/bin/bash /opt/bitnami/php/PDO_PGSQL-1.0.2/libtool --mode=compile cc -I  -I. -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/opt/bitnami/php/PDO_PGSQL-1.0.2/include -I/opt/bitnami/php/PDO_PGSQL-1.0.2/main -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c -o pdo_pgsql.lo
mkdir .libs
 cc -I -I. -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/opt/bitnami/php/PDO_PGSQL-1.0.2/include -I/opt/bitnami/php/PDO_PGSQL-1.0.2/main -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c  -fPIC -DPIC -o .libs/pdo_pgsql.o
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:34:0:
/usr/include/postgresql/pg_config.h:690:0: warning: "PACKAGE_BUGREPORT" redefined [enabled by default]
 #define PACKAGE_BUGREPORT "pgsql-bugs@postgresql.org"
 ^
In file included from /opt/bitnami/php/include/php/TSRM/tsrm_config.h:1:0,
                 from /opt/bitnami/php/include/php/TSRM/tsrm_config_common.h:13,
                 from /opt/bitnami/php/include/php/Zend/zend_virtual_cwd.h:27,
                 from /opt/bitnami/php/include/php/main/php.h:394,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:25:
/opt/bitnami/php/include/php/main/../main/php_config.h:2175:0: note: this is the location of the previous definition
 #define PACKAGE_BUGREPORT ""
 ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:34:0:
/usr/include/postgresql/pg_config.h:693:0: warning: "PACKAGE_NAME" redefined [enabled by default]
 #define PACKAGE_NAME "PostgreSQL"
 ^
In file included from /opt/bitnami/php/include/php/TSRM/tsrm_config.h:1:0,
                 from /opt/bitnami/php/include/php/TSRM/tsrm_config_common.h:13,
                 from /opt/bitnami/php/include/php/Zend/zend_virtual_cwd.h:27,
                 from /opt/bitnami/php/include/php/main/php.h:394,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:25:
/opt/bitnami/php/include/php/main/../main/php_config.h:2178:0: note: this is the location of the previous definition
 #define PACKAGE_NAME ""
 ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:34:0:
/usr/include/postgresql/pg_config.h:696:0: warning: "PACKAGE_STRING" redefined [enabled by default]
 #define PACKAGE_STRING "PostgreSQL 9.3.20"
 ^
In file included from /opt/bitnami/php/include/php/TSRM/tsrm_config.h:1:0,
                 from /opt/bitnami/php/include/php/TSRM/tsrm_config_common.h:13,
                 from /opt/bitnami/php/include/php/Zend/zend_virtual_cwd.h:27,
                 from /opt/bitnami/php/include/php/main/php.h:394,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:25:
/opt/bitnami/php/include/php/main/../main/php_config.h:2181:0: note: this is the location of the previous definition
 #define PACKAGE_STRING ""
 ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:34:0:
/usr/include/postgresql/pg_config.h:699:0: warning: "PACKAGE_TARNAME" redefined [enabled by default]
 #define PACKAGE_TARNAME "postgresql"
 ^
In file included from /opt/bitnami/php/include/php/TSRM/tsrm_config.h:1:0,
                 from /opt/bitnami/php/include/php/TSRM/tsrm_config_common.h:13,
                 from /opt/bitnami/php/include/php/Zend/zend_virtual_cwd.h:27,
                 from /opt/bitnami/php/include/php/main/php.h:394,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:25:
/opt/bitnami/php/include/php/main/../main/php_config.h:2184:0: note: this is the location of the previous definition
 #define PACKAGE_TARNAME ""
 ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:34:0:
/usr/include/postgresql/pg_config.h:702:0: warning: "PACKAGE_VERSION" redefined [enabled by default]
 #define PACKAGE_VERSION "9.3.20"
 ^
In file included from /opt/bitnami/php/include/php/TSRM/tsrm_config.h:1:0,
                 from /opt/bitnami/php/include/php/TSRM/tsrm_config_common.h:13,
                 from /opt/bitnami/php/include/php/Zend/zend_virtual_cwd.h:27,
                 from /opt/bitnami/php/include/php/main/php.h:394,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pdo_pgsql.c:25:
/opt/bitnami/php/include/php/main/../main/php_config.h:2190:0: note: this is the location of the previous definition
 #define PACKAGE_VERSION ""
 ^
/bin/bash /opt/bitnami/php/PDO_PGSQL-1.0.2/libtool --mode=compile cc -I  -I. -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/opt/bitnami/php/PDO_PGSQL-1.0.2/include -I/opt/bitnami/php/PDO_PGSQL-1.0.2/main -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c -o pgsql_driver.lo
 cc -I -I. -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/opt/bitnami/php/PDO_PGSQL-1.0.2/include -I/opt/bitnami/php/PDO_PGSQL-1.0.2/main -I/opt/bitnami/php/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c  -fPIC -DPIC -o .libs/pgsql_driver.o
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'pdo_pgsql_fetch_error_func':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:111:3: error: too many arguments to function 'add_next_index_string'
   add_next_index_string(info, einfo->errmsg, 1);
   ^
In file included from /opt/bitnami/php/include/php/main/php.h:39:0,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:27:
/opt/bitnami/php/include/php/Zend/zend_API.h:433:14: note: declared here
 ZEND_API int add_next_index_string(zval *arg, const char *str);
              ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'pgsql_handle_preparer':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:233:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt);
                                                         ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:251:3: warning: passing argument 5 of 'pdo_parse_params' from incompatible pointer type [enabled by default]
   ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
   ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:31:0:
/opt/bitnami/php/include/php/ext/pdo/php_pdo_driver.h:678:13: note: expected 'size_t *' but argument is of type 'int *'
 PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
             ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:262:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
   spprintf(&S->stmt_name, 0, "pdo_pgsql_stmt_%08x", (unsigned int)stmt);
                                                     ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'pgsql_handle_quoter':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:313:4: warning: passing argument 3 of 'PQescapeBytea' from incompatible pointer type [enabled by default]
    escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen);
    ^
In file included from /opt/bitnami/php/PDO_PGSQL-1.0.2/php_pdo_pgsql.h:24:0,
                 from /opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:39:
/usr/include/postgresql/libpq-fe.h:511:23: note: expected 'size_t *' but argument is of type 'int *'
 extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length,
                       ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'pdo_pgsql_get_attribute':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:383:43: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
    ZVAL_STRING(return_value, PG_VERSION, 1);
                                           ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:383:4: error: 'ZVAL_STRING' undeclared (first use in this function)
    ZVAL_STRING(return_value, PG_VERSION, 1);
    ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:383:4: note: each undeclared identifier is reported only once for each function it appears in
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:389:87: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
     ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version"), 1);
                                                                                       ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:395:64: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
      ZVAL_STRING(return_value, (char *)PQgetvalue(res, 0, 0), 1);
                                                                ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:407:120: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1);
                                                                                                                        ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:407:6: error: 'ZVAL_STRINGL' undeclared (first use in this function)
      ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1);
      ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:412:114: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Connection OK; waiting to send.", sizeof("Connection OK; waiting to send.")-1, 1);
                                                                                                                  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:416:130: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Waiting for a response from the server.", sizeof("Waiting for a response from the server.")-1, 1);
                                                                                                                                  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:420:180: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Received authentication; waiting for backend start-up to finish.", sizeof("Received authentication; waiting for backend start-up to finish.")-1, 1);
                                                                                                                                                                                    ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:428:152: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Negotiating environment-driven parameter settings.", sizeof("Negotiating environment-driven parameter settings.")-1, 1);
                                                                                                                                                        ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:433:82: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
      ZVAL_STRINGL(return_value, "Bad connection.", sizeof("Bad connection.")-1, 1);
                                                                                  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:452:36: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
    ZVAL_STRING(return_value, tmp, 0);
                                    ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'zim_PDO_pgsqlLOBCreate':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:502:6: warning: assignment makes pointer from integer without a cast [enabled by default]
  dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
      ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:511:23: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1
   RETURN_STRING(buf, 0);
                       ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:511:3: error: 'RETURN_STRING' undeclared (first use in this function)
   RETURN_STRING(buf, 0);
   ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'zim_PDO_pgsqlLOBOpen':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:548:6: warning: assignment makes pointer from integer without a cast [enabled by default]
  dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
      ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: In function 'zim_PDO_pgsqlLOBUnlink':
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:588:6: warning: assignment makes pointer from integer without a cast [enabled by default]
  dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
      ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c: At top level:
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:621:2: warning: initialization from incompatible pointer type [enabled by default]
  pgsql_handle_preparer,
  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:621:2: warning: (near initialization for 'pgsql_methods.preparer') [enabled by default]
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:622:2: warning: initialization from incompatible pointer type [enabled by default]
  pgsql_handle_doer,
  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:622:2: warning: (near initialization for 'pgsql_methods.doer') [enabled by default]
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:623:2: warning: initialization from incompatible pointer type [enabled by default]
  pgsql_handle_quoter,
  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:623:2: warning: (near initialization for 'pgsql_methods.quoter') [enabled by default]
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:628:2: warning: initialization from incompatible pointer type [enabled by default]
  pdo_pgsql_last_insert_id,
  ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:628:2: warning: (near initialization for 'pgsql_methods.last_id') [enabled by default]
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:633:1: warning: initialization from incompatible pointer type [enabled by default]
 };
 ^
/opt/bitnami/php/PDO_PGSQL-1.0.2/pgsql_driver.c:633:1: warning: (near initialization for 'pgsql_methods.get_driver_methods') [enabled by default]
make: *** [pgsql_driver.lo] Error 1

Here is my putting command.
pecl download pdo_pgsql
tar xzf PDO_PGSQL-1.0.2.tgz
cd PDO_PGSQL-1.0.2
phpize
./configure
make && sudo make install

Hi,

I am trying to reproduce your issue, in your steps:

you are running ./configure without any parameter, but according to the docs, this command should be

./configure --with-pdo-pgsql=/path/to/your/PostgreSQL/installation

In order to reproduce the issue, could you tell us how you installed Postgresql?

Best regards,
Carlos R. Hernández

Hi! Thanks for replying my question.

I set up my environment by default bitnami wordpress instance delivered by AWS(https://aws.amazon.com/jp/getting-started/tutorials/launch-a-wordpress-website/).

So, I can’t understand where Postgresql was installed.

How can I find installed path?

If you don’t mind, pleases show me in detail.

I checked my PostgreSQL install path by command “ps aux | grep postgres” and there is “/usr/bin/postgres”.

So I put command “./configure --with-pdo-pgsql=/usr/bin/postgres”,but got the same error as as I said before.

How can I solve it? Please show me in detail !!

Hi,

By default, our Wordpress image is released with MySQL 5.7.20, if you want to use PostgreSQL you should install it according to the official guides.

I am reproducing the issue, but it’s a topic that depends a lot on your configuration. I can give you some new guidelines that I have tried but for information regarding the application itself or customization of the content within the application, we highly recommend checking forums and user guides made available by the project behind the application.

/usr/bin/postgres is the path to the executable, but the application is installed in another path, for example /etc/postgresql/9.4/main and this is the one you should use in the ./configure command.

Also, you can try installing this package before the ./configure command

sudo apt-get install libpq-dev

Best regards,
Carlos R. Hernández

Thanks for replying my question.

I tried reset my instance environment by deleting my instance and reinstalling new instance.

And then, I install Postgresql and check whether it is moving by putting command “ps aux | grep postgres” on terminal.

I got this output “postgres 7576 0.0 1.6 251556 16628 ? S 10:23 0:00 /usr/lib/postgresql/9.6/bin/postgres -D /var/lib/postgresql/9.6/main -c config_file=/etc/postgresql/9.6/main/postgresql.conf”.

I understood that postgres install path is “/var/lib/postgresql/9.6/main”

So I put the same command like this.

・pecl download pdo_pgsql
・tar xzf PDO_PGSQL-1.0.2.tgz
・cd PDO_PGSQL-1.0.2
・phpize
・./configure --with-pdo-pgsql=/var/lib/postgresql/9.6/main
・make && sudo make install

In the end, I got the same error as I said before like this.

/bin/bash /usr/bin/PDO_PGSQL-1.0.2/libtool --mode=compile cc -I  -I. -I/usr/bin/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/usr/bin/PDO_PGSQL-1.0.2/include -I/usr/bin/PDO_PGSQL-1.0.2/main -I/usr/bin/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c -o pgsql_driver.lo
cc -I -I. -I/usr/bin/PDO_PGSQL-1.0.2 -DPHP_ATOM_INC -I/usr/bin/PDO_PGSQL-1.0.2/include -I/usr/bin/PDO_PGSQL-1.0.2/main -I/usr/bin/PDO_PGSQL-1.0.2 -I/opt/bitnami/php/include/php -I/opt/bitnami/php/include/php/main -I/opt/bitnami/php/include/php/TSRM -I/opt/bitnami/php/include/php/Zend -I/opt/bitnami/php/include/php/ext -I/opt/bitnami/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c  -fPIC -DPIC -o .libs/pgsql_driver.o
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘pdo_pgsql_fetch_error_func’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:111:3: error: too many arguments to function ‘add_next_index_string’
  add_next_index_string(info, einfo->errmsg, 1);
  ^
In file included from /opt/bitnami/php/include/php/main/php.h:39:0,
                from /usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:27:
/opt/bitnami/php/include/php/Zend/zend_API.h:433:14: note: declared here
ZEND_API int add_next_index_string(zval *arg, const char *str);
             ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘pgsql_handle_preparer’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:233:57: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  spprintf(&S->cursor_name, 0, "pdo_pgsql_cursor_%08x", (unsigned int) stmt);
                                                        ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:251:3: warning: passing argument 5 of ‘pdo_parse_params’ from incompatible pointer type [enabled by default]
  ret = pdo_parse_params(stmt, (char*)sql, sql_len, &nsql, &nsql_len TSRMLS_CC);
  ^
In file included from /usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:31:0:
/opt/bitnami/php/include/php/ext/pdo/php_pdo_driver.h:678:13: note: expected ‘size_t *’ but argument is of type ‘int *’
PDO_API int pdo_parse_params(pdo_stmt_t *stmt, char *inquery, size_t inquery_len,
            ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:262:53: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  spprintf(&S->stmt_name, 0, "pdo_pgsql_stmt_%08x", (unsigned int)stmt);
                                                    ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘pgsql_handle_quoter’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:313:4: warning: passing argument 3 of ‘PQescapeBytea’ from incompatible pointer type [enabled by default]
   escaped = PQescapeBytea(unquoted, unquotedlen, quotedlen);
   ^
In file included from /usr/bin/PDO_PGSQL-1.0.2/php_pdo_pgsql.h:24:0,
                from /usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:39:
/usr/include/postgresql/libpq-fe.h:535:23: note: expected ‘size_t *’ but argument is of type ‘int *’
extern unsigned char *PQescapeBytea(const unsigned char *from, size_t from_length,
                      ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘pdo_pgsql_get_attribute’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:383:43: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
   ZVAL_STRING(return_value, PG_VERSION, 1);
                                          ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:383:4: error: ‘ZVAL_STRING’ undeclared (first use in this function)
   ZVAL_STRING(return_value, PG_VERSION, 1);
   ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:383:4: note: each undeclared identifier is reported only once for each function it appears in
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:389:87: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
    ZVAL_STRING(return_value, (char*)PQparameterStatus(H->server, "server_version"), 1);
                                                                                      ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:395:64: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
     ZVAL_STRING(return_value, (char *)PQgetvalue(res, 0, 0), 1);
                                                               ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:407:120: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1);
                                                                                                                       ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:407:6: error: ‘ZVAL_STRINGL’ undeclared (first use in this function)
     ZVAL_STRINGL(return_value, "Waiting for connection to be made.", sizeof("Waiting for connection to be made.")-1, 1);
     ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:412:114: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Connection OK; waiting to send.", sizeof("Connection OK; waiting to send.")-1, 1);
                                                                                                                 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:416:130: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Waiting for a response from the server.", sizeof("Waiting for a response from the server.")-1, 1);
                                                                                                                                 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:420:180: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Received authentication; waiting for backend start-up to finish.", sizeof("Received authentication; waiting for backend start-up to finish.")-1, 1);
                                                                                                                                                                                   ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:428:152: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Negotiating environment-driven parameter settings.", sizeof("Negotiating environment-driven parameter settings.")-1, 1);
                                                                                                                                                       ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:433:82: error: macro "ZVAL_STRINGL" passed 4 arguments, but takes just 3
     ZVAL_STRINGL(return_value, "Bad connection.", sizeof("Bad connection.")-1, 1);
                                                                                 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:452:36: error: macro "ZVAL_STRING" passed 3 arguments, but takes just 2
   ZVAL_STRING(return_value, tmp, 0);
                                   ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘zim_PDO_pgsqlLOBCreate’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:502:6: warning: assignment makes pointer from integer without a cast [enabled by default]
 dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
     ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:511:23: error: macro "RETURN_STRING" passed 2 arguments, but takes just 1
  RETURN_STRING(buf, 0);
                      ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:511:3: error: ‘RETURN_STRING’ undeclared (first use in this function)
  RETURN_STRING(buf, 0);
  ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘zim_PDO_pgsqlLOBOpen’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:548:6: warning: assignment makes pointer from integer without a cast [enabled by default]
 dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
     ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: In function ‘zim_PDO_pgsqlLOBUnlink’:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:588:6: warning: assignment makes pointer from integer without a cast [enabled by default]
 dbh = zend_object_store_get_object(getThis() TSRMLS_CC);
     ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c: At top level:
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:621:2: warning: initialization from incompatible pointer type [enabled by default]
 pgsql_handle_preparer,
 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:621:2: warning: (near initialization for ‘pgsql_methods.preparer’) [enabled by default]
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:622:2: warning: initialization from incompatible pointer type [enabled by default]
 pgsql_handle_doer,
 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:622:2: warning: (near initialization for ‘pgsql_methods.doer’) [enabled by default]
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:623:2: warning: initialization from incompatible pointer type [enabled by default]
 pgsql_handle_quoter,
 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:623:2: warning: (near initialization for ‘pgsql_methods.quoter’) [enabled by default]
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:628:2: warning: initialization from incompatible pointer type [enabled by default]
 pdo_pgsql_last_insert_id,
 ^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:628:2: warning: (near initialization for ‘pgsql_methods.last_id’) [enabled by default]
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:633:1: warning: initialization from incompatible pointer type [enabled by default]
};
^
/usr/bin/PDO_PGSQL-1.0.2/pgsql_driver.c:633:1: warning: (near initialization for ‘pgsql_methods.get_driver_methods’) [enabled by default]
make: *** [pgsql_driver.lo] Error 1

How can I solve?

Hi @ken.rad0202,

We have been checking the issue you are running into and unfortunately it seems that the PECL package for PDO PGSQL has not been updated since long time ago. The latest release was in 2006.

https://pecl.php.net/package/PDO_PGSQL

The issues you are running into when using PHP 7 are probably related with that. We build PHP with the bundled pdo_pgsql drivers in the LAPP stack because we include PostgreSQL too.

In case you want to use WordPress with PostgrSQL, you can launch a LAPP instance and follow this documentation to deploy WordPress in the same server.

https://docs.bitnami.com/aws/infrastructure/lapp/#how-to-create-a-custom-php-application

Regards,
Jota

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.