1. [root@wehecshk /]# whereis phpize
phpize: /usr/bin/phpize
2. [root@wehecshk /]# usr/bin/phpize
Cannot find config.m4.
Make sure that you run 'usr/bin/phpize' in the top level source directory of the module
3. [root@wehecshk /]# cd www/server/php/72/src/ext/pgsql
4. [root@wehecshk pgsql]# /usr/bin/phpize
5. [root@wehecshk pgsql]# ./configure --with-php-config=/www/server/php/72/bin/php-config
......
checking for PostgreSQL support... yes, shared
checking for pg_config... not found
configure: error: Cannot find libpq-fe.h. Please specify correct PostgreSQL installation path
6. [root@wehecshk pgsql]# yum -y install postgresql-devel
7. [root@wehecshk pgsql]# ./configure --with-php-config=/www/server/php/72/bin/php-config
......
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
8. [root@wehecshk pgsql]# make && make install
......
Libraries have been installed in:
/www/server/php/72/src/ext/pgsql/modules #会有一个 pgsql.so文件
......
Build complete.
Don't forget to run 'make test'.
Installing shared extensions: /www/server/php/72/lib/php/extensions/no-debug-non-zts-20170718/
9. [root@wehecshk pgsql]# make test
10. vi /www/server/php/72/etc/php.ini
;PHP Support PGSQL
extension=pgsql.so
; disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,popen,proc_open,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru
disable_functions = shell_exec, system, passthru, exec, popen
11. [root@wehecshk pgsql]# systemctl restart httpd
注意:最后重启php 与 apache