pppscn 发表于 2017-1-7 08:11:47

关于改进Get_PHP_Ext_Dir的建议

事件起因,因为我在PHP_Modules_Options中加了--enable-maintainer-zts选项(为了支持多线程pthreads)

但是——

./addons.sh install memcached
./addons.sh install redis
./addons.sh install imagemagick


全部最后报安装失败!

原因在于lnmp固定扩展目录为non-zts的,所以建议军哥能改进一下获取方法


这是我目前改之后的方法:(只有编译php7跟php5.6,其他未测试)
Get_PHP_Ext_Dir()
{
    Cur_PHP_Version=`/usr/local/php/bin/php -r 'echo PHP_VERSION;'`
    PHP_EXTENSION_DIR=`/usr/local/php/bin/php -r 'echo PHP_EXTENSION_DIR;'`
    zend_ext_dir=${PHP_EXTENSION_DIR}"/"
    # if echo "${Cur_PHP_Version}" | grep -Eqi '^5.2.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20060613/"
    # elif echo "${Cur_PHP_Version}" | grep -Eqi '^5.3.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20090626/"
    # elif echo "${Cur_PHP_Version}" | grep -Eqi '^5.4.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20100525/"
    # elif echo "${Cur_PHP_Version}" | grep -Eqi '^5.5.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20121212/"
    # elif echo "${Cur_PHP_Version}" | grep -Eqi '^5.6.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/"
   # elif echo "${Cur_PHP_Version}" | grep -Eqi '^7.0.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20151012/"
   # elif echo "${Cur_PHP_Version}" | grep -Eqi '^7.1.'; then
       # zend_ext_dir="/usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/"
   # fi
}

licess 发表于 2017-1-7 18:46:24

收到
页: [1]
查看完整版本: 关于改进Get_PHP_Ext_Dir的建议