1
0

pecl_pgsql.sh 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. # Author: yeho <lj2007331 AT gmail.com>
  3. # BLOG: https://blog.linuxeye.com
  4. #
  5. # Notes: OneinStack for CentOS/RadHat 5+ Debian 6+ and Ubuntu 12+
  6. #
  7. # Project home page:
  8. # https://oneinstack.com
  9. # https://github.com/lj2007331/oneinstack
  10. Install_pecl-pgsql() {
  11. pushd ${oneinstack_dir}/src
  12. phpExtensionDir=`${php_install_dir}/bin/php-config --extension-dir`
  13. PHP_detail_version=$(${php_install_dir}/bin/php -r 'echo PHP_VERSION;')
  14. tar xzf php-${PHP_detail_version}.tar.gz
  15. pushd php-${PHP_detail_version}/ext/pgsql
  16. ${php_install_dir}/bin/phpize
  17. ./configure --with-pgsql=${pgsql_install_dir} --with-php-config=${php_install_dir}/bin/php-config
  18. make -j ${THREAD} && make install
  19. popd
  20. if [ -f "${phpExtensionDir}/pgsql.so" ]; then
  21. echo 'extension=pgsql.so' > ${php_install_dir}/etc/php.d/ext-pgsql.ini
  22. echo "${CSUCCESS}PHP pgsql module installed successfully! ${CEND}"
  23. popd
  24. rm -rf php-${PHP_detail_version}
  25. else
  26. echo "${CFAILURE}PHP pgsql module install failed, Please contact the author! ${CEND}"
  27. fi
  28. popd
  29. }