虚心使人进步

虚心学习,天天向上......
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

mac 源码安装php8.4

Posted on 2024-11-28 17:43  Showker  阅读(12)  评论(0编辑  收藏  举报
安装所需依赖项目
brew install autoconf bison re2c libxml2 openssl@3 libiconv icu4c bzip2 readline krb5 curl


# #!/bin/bash

# # 清理之前的编译结果
# make clean
# rm -rf config.cache

# # 设置PKG_CONFIG_PATH
export PKG_CONFIG_PATH="/usr/local/opt/krb5/lib/pkgconfig:/usr/local/opt/openssl@3/lib/pkgconfig:/usr/local/opt/libiconv/lib/pkgconfig:/usr/local/opt/icu4c/lib/pkgconfig:/usr/local/opt/readline/lib/pkgconfig:$PKG_CONFIG_PATH"

# # 设置CFLAGS和LDFLAGS,确保不重复
# export CFLAGS="-I/opt/homebrew/opt/krb5/include -I/opt/homebrew/opt/bzip2/include -I/opt/homebrew/opt/libiconv/include -I/opt/homebrew/opt/icu4c/include -I/opt/homebrew/opt/readline/include"
# export LDFLAGS="-L/opt/homebrew/opt/krb5/lib -L/opt/homebrew/opt/bzip2/lib -L/opt/homebrew/opt/libiconv/lib -L/opt/homebrew/opt/icu4c/lib -L/opt/homebrew/opt/readline/lib"

# 运行配置脚本

./configure OPENSSL_CFLAGS=-I/usr/local/opt/openssl@3/include/ OPENSSL_LIBS="-L/usr/local/opt/openssl@3/lib/ -lssl -lcrypto" \
PKG_CONFIG_PATH=/usr/local/lib/pkgconfig \
--prefix=/usr/local/etc/php/8.4 \
--with-config-file-path=/usr/local/etc/php/8.4/etc \
--with-config-file-scan-dir=/usr/local/etc/php/8.4/etc/php.d \
--enable-bcmath \
--enable-calendar \
--enable-exif \
--enable-fpm \
--enable-intl \
--enable-mbstring \
--enable-mysqlnd \
--enable-opcache \
--enable-pcntl \
--enable-soap \
--enable-sockets \
--with-bz2=/usr/local/opt/bzip2 \
--with-curl \
--with-freetype \
--with-jpeg \
--with-kerberos=/usr/local/opt/krb5 \
--with-libxml \
--with-mysqli \
--with-openssl=/usr/local/opt/openssl@3 \
--with-pdo-mysql \
--with-pdo-sqlite \
--with-readline=/usr/local/opt/readline \
--with-xsl \
--with-zlib \
--with-iconv=/usr/local/opt/libiconv