diff --git a/plugins/php/index.py b/plugins/php/index.py index e8997a43f..915d9915b 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -344,7 +344,7 @@ def phpOp(version, method): def start(version): - cmd = 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/www/server/lib/icu/lib' + cmd = 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/www/server/lib/icu/lib:/opt/homebrew/lib' mw.execShell(cmd) return phpOp(version, 'start') diff --git a/plugins/php/versions/common/openssl.sh b/plugins/php/versions/common/openssl.sh index 75ad433b3..b76a61535 100755 --- a/plugins/php/versions/common/openssl.sh +++ b/plugins/php/versions/common/openssl.sh @@ -70,13 +70,36 @@ Install_lib() mv config0.m4 config.m4 fi + OPTIONS="" + if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then + OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" + fi + # openssl_version=`pkg-config openssl --modversion` # export PKG_CONFIG_PATH=$serverPath/lib/openssl10/lib/pkgconfig if [ "$version" -lt "81" ] && [ "$sysName" != "Darwin" ];then export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$serverPath/lib/openssl10/lib/pkgconfig fi - if [ "$sysName" == "Darwin" ];then + # Darwin + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/bin/php + # lldb /Users/midoks/Desktop/mwdev/server/php/83/bin/php -r 'phpinfo()' + # otool -L /Users/midoks/Desktop/mwdev/server/php/83/lib/php/extensions/no-debug-non-zts-20230831/openssl.so + # ldd /www/server/php/83/bin/php + + if [ "$version" -lt "83" ] && [ "$sysName" == "Darwin" ];then + BREW_DIR=`which brew` + BREW_DIR=${BREW_DIR/\/bin\/brew/} + LIB_DEPEND_DIR=`brew info openssl@1.0 | grep ${BREW_DIR}/Cellar/openssl@1.0 | cut -d \ -f 1 | awk 'END {print}'` + OPTIONS="$OPTIONS --with-openssl=$(brew --prefix openssl@1.0)" + export PKG_CONFIG_PATH=$LIB_DEPEND_DIR/lib/pkgconfig + export OPENSSL_CFLAGS="-I${LIB_DEPEND_DIR}/include" + export OPENSSL_LIBS="-L/${LIB_DEPEND_DIR}/lib -lssl -lcrypto -lz" + + echo "$LIB_DEPEND_DIR/lib/pkgconfig" + fi + + if [ "$version" -ge "84" ] && [ "$sysName" == "Darwin" ];then BREW_DIR=`which brew` BREW_DIR=${BREW_DIR/\/bin\/brew/} LIB_DEPEND_DIR=`brew info openssl | grep ${BREW_DIR}/Cellar/openssl | cut -d \ -f 1 | awk 'END {print}'` @@ -90,20 +113,16 @@ Install_lib() # export PKG_CONFIG_PATH=$serverPath/lib/openssl/lib/pkgconfig # fi - OPTIONS="" - if [ "${SYS_ARCH}" == "aarch64" ] && [ "$version" -lt "56" ];then - OPTIONS="$OPTIONS --build=aarch64-unknown-linux-gnu --host=aarch64-unknown-linux-gnu" - fi - + $serverPath/php/$version/bin/phpize # --with-openssl echo "./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS" ./configure --with-php-config=$serverPath/php/$version/bin/php-config $OPTIONS make clean && make && make install && make clean - # if [ -d $sourcePath/php${version} ];then - # cd ${sourcePath} && rm -rf $sourcePath/php${version} - # fi + if [ -d $sourcePath/php${version} ];then + cd ${sourcePath} && rm -rf $sourcePath/php${version} + fi fi