From 25f3b5b18d86c94e27b180c7db6818720e2e7c89 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Fri, 10 Nov 2023 23:29:36 +0800 Subject: [PATCH] Create pcre.sh --- plugins/php/lib/pcre.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/php/lib/pcre.sh diff --git a/plugins/php/lib/pcre.sh b/plugins/php/lib/pcre.sh new file mode 100644 index 000000000..96f6033fb --- /dev/null +++ b/plugins/php/lib/pcre.sh @@ -0,0 +1,36 @@ +#!/bin/bash +PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin:/opt/homebrew/bin +export PATH + +curPath=`pwd` +rootPath=$(dirname "$curPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") +rootPath=$(dirname "$rootPath") + +SERVER_ROOT=$rootPath/lib +SOURCE_ROOT=$rootPath/source/lib +mkdir -p $SOURCE_ROOT + +pcreVersion='8.38' + +if [ ! -d ${SERVER_ROOT}/pcre ];then + cd ${SOURCE_ROOT} + + if [ ! -f ${SOURCE_ROOT}/pcre-${pcreVersion}.tar.gz ];then + wget --no-check-certificate -O ${SOURCE_ROOT}/pcre-${pcreVersion}.tar.gz https://netix.dl.sourceforge.net/project/pcre/pcre/${pcreVersion}/pcre-${pcreVersion}.tar.gz + fi + + + if [ ! -d ${SOURCE_ROOT}/pcre-${pcreVersion} ];then + cd ${SOURCE_ROOT} && tar -zxvf pcre-${pcreVersion}.tar.gz + + fi + + cd ${SOURCE_ROOT}/pcre-${pcreVersion} + ./configure --prefix=${SERVER_ROOT}/pcre + make && make install + + cd $SOURCE_ROOT && rm -rf ${SOURCE_ROOT}/pcre-${pcreVersion} +fi +