1. 程式人生 > >Ubuntu16.04下使用lnmp軟體包搭建開發環境安裝擴充套件pdo_pgsql擴充套件報錯Can't find the 'libpq-fe.h header

Ubuntu16.04下使用lnmp軟體包搭建開發環境安裝擴充套件pdo_pgsql擴充套件報錯Can't find the 'libpq-fe.h header

1.安裝pgsql擴充套件

[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ phpize 
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[email protected]:~/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql$ ./configure --with-php-config=/usr/local/php/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... gawk
checking for PostgreSQL support... yes, shared
checking for pg_config... /usr/bin/pg_config
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path

由於該檔案是libpq-dev軟體包的一部分,需要安裝該軟體包:

[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ sudo apt-get install libpq-dev
正在讀取軟體包列表... 完成
正在分析軟體包的依賴關係樹       
正在讀取狀態資訊... 完成       
下列軟體包是自動安裝的並且現在不需要了:
  php-common
使用'sudo apt autoremove'來解除安裝它(它們)。
建議安裝:
  postgresql-doc-9.5
下列【新】軟體包將被安裝:
  libpq-dev
升級了 0 個軟體包,新安裝了 1 個軟體包,要解除安裝 0 個軟體包,有 6 個軟體包未被升級。
需要下載 0 B/154 kB 的歸檔。
解壓縮後會消耗 786 kB 的額外空間。
正在選中未選擇的軟體包 libpq-dev。
(正在讀取資料庫 ... 系統當前共安裝有 227218 個檔案和目錄。)
正準備解包 .../libpq-dev_9.5.12-0ubuntu0.16.04_amd64.deb  ...
正在解包 libpq-dev (9.5.12-0ubuntu0.16.04) ...
正在處理用於 man-db (2.7.5-1) 的觸發器 ...
正在設定 libpq-dev (9.5.12-0ubuntu0.16.04) ...
[email protected]
:~/lnmp1.4/src/php-7.1.15/ext/pgsql$

再次安裝不會報錯

[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ ./configure --with-php-config=/usr/local/php/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... gawk
checking for PostgreSQL support... yes, shared
checking for pg_config... /usr/bin/pg_config
checking for PQescapeString in -lpq... yes
checking for PQunescapeBytea in -lpq... yes
checking for PQsetnonblocking in -lpq... yes
checking for PQcmdTuples in -lpq... yes
checking for PQoidValue in -lpq... yes
checking for PQclientEncoding in -lpq... yes
checking for PQparameterStatus in -lpq... yes
checking for PQprotocolVersion in -lpq... yes
checking for PQtransactionStatus in -lpq... yes
checking for PQexecParams in -lpq... yes
checking for PQprepare in -lpq... yes
checking for PQexecPrepared in -lpq... yes
checking for PQresultErrorField in -lpq... yes
checking for PQsendQueryParams in -lpq... yes
checking for PQsendPrepare in -lpq... yes
checking for PQsendQueryPrepared in -lpq... yes
checking for PQputCopyData in -lpq... yes
checking for PQputCopyEnd in -lpq... yes
checking for PQgetCopyData in -lpq... yes
checking for PQfreemem in -lpq... yes
checking for PQsetErrorVerbosity in -lpq... yes
checking for PQftable in -lpq... yes
checking for PQescapeStringConn in -lpq... yes
checking for PQescapeByteaConn in -lpq... yes
checking for pg_encoding_to_char in -lpq... yes
checking for lo_create in -lpq... yes
checking for lo_import_with_oid in -lpq... yes
checking for lo_truncate in -lpq... yes
checking for lo_truncate64 in -lpq... yes
checking for PQescapeLiteral in -lpq... yes
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ make &&sudo make install
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/pgsql.c -o pgsql.lo 
mkdir .libs
 cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/pgsql.c  -fPIC -DPIC -o .libs/pgsql.o
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/libtool --mode=link cc -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -o pgsql.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules  pgsql.lo -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lpq
cc -shared  .libs/pgsql.o  -L/usr/lib/x86_64-linux-gnu -lpq  -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu -Wl,-soname -Wl,pgsql.so -o .libs/pgsql.so
creating pgsql.la
(cd .libs && rm -f pgsql.la && ln -s ../pgsql.la pgsql.la)
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/libtool --mode=install cp ./pgsql.la /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules
cp ./.libs/pgsql.so /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules/pgsql.so
cp ./.libs/pgsql.lai /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules/pgsql.la
PATH="$PATH:/sbin" ldconfig -n /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
[email protected]:~/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pgsql$

2.安裝pdo_pgsql

[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ cd ..  
[email protected]:~/lnmp1.4/src/php-7.1.15/ext$ cd pdo_pgsql/  
[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql$ phpize
Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303
[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql$ ls
acinclude.m4    config.sub    Makefile.global    php_pdo_pgsql.h
aclocal.m4      configure     missing            php_pdo_pgsql_int.h
autom4te.cache  configure.in  mkinstalldirs      run-tests.php
build           config.w32    package2.xml       tests
config.guess    CREDITS       pdo_pgsql.c
config.h.in     install-sh    pgsql_driver.c
config.m4       ltmain.sh     pgsql_statement.c
[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql$ ./configure --with-php-config=/usr/local/php/bin/php-config
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... cc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking target system type... x86_64-unknown-linux-gnu
checking for PHP prefix... /usr/local/php
checking for PHP includes... -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib
checking for PHP extension directory... /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303
checking for PHP installed headers prefix... /usr/local/php/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... re2c
checking for re2c version... 0.16 (ok)
checking for gawk... gawk
checking for PostgreSQL support for PDO... yes, shared
checking for pg_config... /usr/bin/pg_config
checking for openssl dependencies... no
checking for PQprepare in -lpq... yes
checking for PQexecParams in -lpq... yes
checking for PQescapeStringConn in -lpq... yes
checking for PQescapeByteaConn in -lpq... yes
checking for PDO includes... checking for PDO includes... /usr/local/php/include/php/ext
checking for ld used by cc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -B
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 1572864
checking command to parse /usr/bin/nm -B output from cc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fPIC
checking if cc PIC flag -fPIC works... yes
checking if cc static flag -static works... yes
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no

creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql$ make && sudo make install
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/local/php/include/php/ext  -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pdo_pgsql.c -o pdo_pgsql.lo 
mkdir .libs
 cc -I/usr/local/php/include/php/ext -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pdo_pgsql.c  -fPIC -DPIC -o .libs/pdo_pgsql.o
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/local/php/include/php/ext  -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pgsql_driver.c -o pgsql_driver.lo 
 cc -I/usr/local/php/include/php/ext -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pgsql_driver.c  -fPIC -DPIC -o .libs/pgsql_driver.o
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/libtool --mode=compile cc -I/usr/local/php/include/php/ext  -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pgsql_statement.c -o pgsql_statement.lo 
 cc -I/usr/local/php/include/php/ext -I. -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql -DHAVE_CONFIG_H -g -O2 -c /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/pgsql_statement.c  -fPIC -DPIC -o .libs/pgsql_statement.o
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/libtool --mode=link cc -DPHP_ATOM_INC -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/include -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/main -I/home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql -I/usr/local/php/include/php -I/usr/local/php/include/php/main -I/usr/local/php/include/php/TSRM -I/usr/local/php/include/php/Zend -I/usr/local/php/include/php/ext -I/usr/local/php/include/php/ext/date/lib -I/usr/include/postgresql  -DHAVE_CONFIG_H  -g -O2   -o pdo_pgsql.la -export-dynamic -avoid-version -prefer-pic -module -rpath /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules  pdo_pgsql.lo pgsql_driver.lo pgsql_statement.lo -Wl,-rpath,/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu -lpq
cc -shared  .libs/pdo_pgsql.o .libs/pgsql_driver.o .libs/pgsql_statement.o  -L/usr/lib/x86_64-linux-gnu -lpq  -Wl,-rpath -Wl,/usr/lib/x86_64-linux-gnu -Wl,-soname -Wl,pdo_pgsql.so -o .libs/pdo_pgsql.so
creating pdo_pgsql.la
(cd .libs && rm -f pdo_pgsql.la && ln -s ../pdo_pgsql.la pdo_pgsql.la)
/bin/bash /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/libtool --mode=install cp ./pdo_pgsql.la /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules
cp ./.libs/pdo_pgsql.so /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules/pdo_pgsql.so
cp ./.libs/pdo_pgsql.lai /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules/pdo_pgsql.la
PATH="$PATH:/sbin" ldconfig -n /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules
----------------------------------------------------------------------
Libraries have been installed in:
   /home/ming/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql/modules

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------

Build complete.
Don't forget to run 'make test'.

Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
[email protected]:~/lnmp1.4/lnmp1.4/src/php-7.1.15/ext/pdo_pgsql$ 

3.配置php.ini

開啟php.ini檔案將pdo_pgsql.dll去掉註釋並改為extension=pdo_pgsql.so

(非lnmp包安裝的話需要跟上pdo_pgsql.so或者pgsql的完整路徑)

安裝完成後開啟網頁在phpInfo能看到pdo_pgsql的資訊,或者執行php -m檢視擴充套件是否有這個東東
pdo_pgsql
PDO Driver for PostgreSQLenabled
PostgreSQL(libpq) Version9.5.12
Module version7.1.15

Revision$Id: 9c5f356c77143981d2e905e276e439501fe0f419 $

相關推薦

Ubuntu16.04使用lnmp軟體搭建開發環境安裝擴充套件pdo_pgsql擴充套件Can't find the 'libpq-fe.h header

1.安裝pgsql擴充套件[email protected]:~/lnmp1.4/src/php-7.1.15/ext/pgsql$ phpize Configuring for: PHP Api Version: 20160303 Zend Mo

Ubuntu16.04使用sublime text3搭建Python IDE

本來是想用pycharm,但你看它的記憶體要求,我的虛擬機器一共也就1G Vim太彆扭了,就算有程式碼顏色,不能自動對齊,不能規範格式,跳轉到函式定義,顯示文件,要配置起來太費勁,所以就嘗試著用sublime text3 來搭建Python IDE 安裝sublime

Ubuntu16.04arm-linux-gcc交叉編譯環境搭建

Ubuntu下arm-Linux-gcc交叉編譯環境搭建 參考:http://blog.csdn.net/hebbely/article/details/53992805 1、網上下載 arm-

Ubuntu16.04製作deb的方法詳解

1 認識deb包 1.1 認識deb包 deb是Unix系統(其實主要是Linux)下的安裝包,基於 tar 包,因此本身會記錄檔案的許可權(讀/寫/可執行)以及所有者/使用者組。 由於 Unix 類系統對許可權、所有者、組的嚴格要求,而 d

ubuntu16.04LTSgedit的C語言開發環境簡單配置

   在這個編輯器下鼓搗了兩天終於把環境配置好了,現在不需要在終端裡敲命令就能編譯執行C語言了,真是非常的方便,編輯器還有很多外掛可以使用。 這個版本的編輯器有一點不方便的就是選單欄與編輯器分離,害我找了好久。。。。選單欄在螢幕最上方的黑條條裡,將滑鼠移過去就能發現了。  

Ubuntu16.04nginx、ftp、mysql的安裝配置及使用者建立

    在阿里雲購買伺服器後,需要安裝一些最基本的服務:nginx、ftp、mysql,注意在阿里雲安全組配置相關埠(80,21,22埠)。     安裝過程主要參考其他教程,我在他人教程的基礎上記錄一些遇到的問題及解決辦法。 一、Ubuntu中安裝配置nginx

Ubuntu16.04建立只有python3的虛擬環境

用 virtualvenvwrapper 建立的虛擬環境裡 既有 py2 還有 py3 ,pip啥的也是亂七八糟的,有髒東西,改用 python3 自帶的 venv 建立純淨的,只有 python3 ,pip也只對應 python3 的虛擬環境 安裝 pyth

[Mini2440 - 005] 搭建開發環境 - 安裝 ubuntu 後習慣配置

習慣 mini 使用 vim vim 編輯器 clas apt-get u-boot oot 一、設置root用戶密碼 sudo passwd root 二、安裝 Vim 編輯器 sudo apt-get install vim-nox 三、安裝 32 位兼

Ubuntu 16.04 機器學習和人工智慧的環境安裝(較詳盡)

為什麼用Ubuntu?         ubuntu是目前最為流行的linux的發行版,安裝簡單,視覺化,傻瓜化。目前的相關社群也比較完善,網上資料豐富,是新手上手linux環境下開發比較不錯的一個版本。         ubuntu目前一般每隔兩年會發行一版LTS版本,

centos 軟體衝突,無法安裝php-mysql擴充套件

在centos上配置lamp環境時,系統中已存在了mysql5.5,需要在不重新安裝mysql的前提下配置好lamp環境,中間遇到了php-mysql擴充套件無法安裝的情況。 使用yum安裝php-mysql擴充套件,提示同時需要mysql-lib依賴,但是在

julia開發環境安裝——VS code擴充套件和JuliaPro兩種方式

VS code擴充套件方式 首先,下載安裝julia1.0.0:我的上一篇文章 完成後,配置系統環境變數: 控制面板\所有控制面板項\系統–>高階系統設定 高階欄下點選系統變數~ 如圖: 在path下新增你的julia/bin路徑如(圖):G:\Julia-1.0.0

android工程引入第三方jar,發現混淆後無法簽名,並出現can't find referenced class

1 出現can't find referenced class的警告時,可以在proguard.cfg中新增-ignorewarnings或-dontwarn來解決。 2 對於有的第三方jar,可能已經進行過程式碼混淆了,在這裡就要保持(防止出現空指標或者其他莫名其妙的問題

ubuntu16.04原始碼搭建lnmp開發環境並部署laravel專案到線上

之前都是使用lnmp安裝包來搭建線上環境,今天試試原始碼搭建環境,雖然之前搭建過一次,但許久不操作還是有點忘記了,好了,廢話不多說開始正題。 開始安裝前先執行sudo apt-get update更新一下軟體庫 我們先安裝nginx,執行sudo apt-get inst

Ubuntu16.04搭建開發環境及編譯tiny4412 Android系統

1.安裝ssh伺服器(可通過網路遠端登入系統,如putty、xshell) sudo apt-get install openssh-server 2.安裝ftp伺服器(預設已安裝)  windows 可使用leapFTP工具登入 sudo apt-get in

ubuntu16.04 C# 開發環境搭建

1.安裝C#編譯環境 sudo apt-get install mono-devel 2.檢視mono版本 mono --version 3.檢視gmcs版本 gmcs --version 安裝IDE獲取更強大的功能 sudo apt-get install

Ubuntu16.04搭建python開發環境

準備工作:安裝虛擬機器,並下載安裝Ubuntu16.04系統 1.ubuntu預設root使用者沒有啟用,啟用root使用者,就要為root使用者建立密碼 $sudo passwd root 2、修改主機名 $vi /etc/hostname 3、安裝ssh服務 $sudo

騰訊雲Ubuntu16.04搭建Java開發環境(工具,JDK,Eclipse,MySQL,Tomcat)

工具使用 1.WinSCP:用來傳輸檔案 2.PuTTY:用來開啟命令列 JDK環境配置 1.首先配置jdk環境,到官網下載jdk的linux版本 2.建立目錄/usr/local/java用於存放jdk檔案 mkdir /usr/local/jav

Ubuntu16.04搭建ssh環境

ubuntu virtualbox nat 宿主機虛擬機互相訪問環境:宿主機 Ubuntu16.04 虛擬機VirtualBox5.0.40 子系統 CentOS6.6CentSO子系統在NAT網絡下,通過VirtualBox的端口轉發功能實現宿主機與虛擬機之間的訪問,以便使用ssh遠程登錄虛擬機

Ubuntu16.04Scrapy環境搭建

scrapy環境部署 pycharm配置運行spider一、Scrapy簡介與部署環境 Scrapy是一個為了爬取網站數據,提取結構性數據而編寫的第三方爬蟲框架。 可以應用在包括數據挖掘,信息處理或存儲歷史數據等一系列的程序中。 最初是為了頁面抓取 (更確切來說, 網絡抓取 )所

Ubuntu16.04安裝Chrome出現“未安裝軟件 libappindicator1”問題的解決辦法

googl spa 軟件包 依賴 mic 安裝軟件 ren for 其中 1. 強制安裝chrome sudo dpkg -i google-chrome-stable_current_i386.deb --force 2. 補齊依賴 sudo apt-get i