你全力做到最好,可能还不如别人随便搞搞!

发掘积累过程的快感

首页 » BIBLE模型 » 运维 » php编译安装

php编译安装


7.3.x 版本安装

安装所需依赖
由于需要 libzip 高版本,所以需要 cmake,首先编译安装 cmake,然后编译安装 libzip。

cmake 官网:https://cmake.org/download/

libzip 官网:https://libzip.org/download/

然后安装相关依赖

yum install -y systemd-devel \
systemtap-sdt-devel \
libxml2-devel \
openssl-devel \
bzip2-devel \
curl-devel \
libwebp-devel \
libjpeg-devel \
libpng-devel \
freetype-devel \
gmp-devel \
libicu-devel \
glibc-headers gcc-c++

如果遇到:configure: error: off_t undefined; check your library configuration

添加搜索路径到配置文件

echo '/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64'>>/etc/ld.so.conf

更新配置

ldconfig -v

编译 PHP
编译完成后,在 sapi/fpm 中有个 init.d.php-fpm 安装完成后需要复制到 init.d 文件中。

./configure --prefix=/usr/local/php-7.3 \
--exec-prefix=/usr/local/php-7.3 \
--with-config-file-path=/usr/local/php-7.3/etc \
--enable-fpm \
--with-fpm-user=daemon \
--with-fpm-group=daemon \
--with-openssl \
--with-zlib \
--with-bz2 \
--with-curl \
--with-gd \
--with-freetype-dir \
--enable-exif \
--with-webp-dir \
--with-jpeg-dir \
--with-png-dir \
-with-gettext \
--with-gmp \
--with-mhash \
--with-iconv \
--enable-intl \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/mariadb/mysql.sock \
--with-pdo-mysql=mysqlnd \
--with-pdo-sqlite \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-wddx \
--enable-zip \
--with-libzip \
--enable-mysqlnd \
--with-openssl \
--with-fpm-systemd \
--enable-opcache \
--enable-shmop \
--enable-xml \
--enable-dtrace \
--disable-rpath \
--with-pcre-regex \
--with-xmlrpc \
--with-imap-ssl \
--enable-pcntl \
--enable-mbstring

最新 7.4 版本编译安装

依赖环境 oniguruma-devel
环境变量设置
export LIBZIP_CFLAGS=/usr/local/lib64
export LIBZIP_LIBS=/usr/local/lib64

编译选项

./configure --prefix=/usr/local/php-7.4.0 \
--with-config-file-path=/usr/local/php-7.4.0/etc \
--enable-fpm \
--with-fpm-user=daemon \
--with-fpm-group=daemon \
--with-openssl \
--with-zlib \
--with-curl \
--enable-gd \
--with-webp \
--with-jpeg \
--with-freetype \
--enable-gd-jis-conv \
--enable-exif \
-with-gettext \
--with-gmp \
--with-mhash \
--with-iconv \
--enable-intl \
--with-mysqli=mysqlnd \
--with-mysql-sock=/var/mariadb/mysql.sock \
--with-pdo-mysql=mysqlnd \
--enable-soap \
--enable-sockets \
--enable-sysvmsg \
--enable-sysvsem \
--enable-sysvshm \
--enable-mysqlnd \
--with-openssl \
--with-fpm-systemd \
--enable-opcache \
--enable-shmop \
--enable-xml \
--enable-dtrace \
--disable-rpath \
--with-pcre-jit \
--without-sqlite3 \
--without-pdo-sqlite \
--with-xmlrpc \
--with-imap-ssl \
--enable-pcntl \
--enable-mbstring
互联网信息太多太杂,各互联网公司不断推送娱乐花边新闻,SNS,微博不断转移我们的注意力。但是,我们的时间和精力却是有限的。这里是互联网浩瀚的海洋中的一座宁静与美丽的小岛,供开发者歇息与静心潜心修炼。 “Bible”是圣经,有权威的书,我们的本意就是为开发者提供真正有用的的资料。 我的电子邮件 1217179982@qq.com,您在开发过程中遇到任何问题,欢迎与我联系。
Copyright © 2024. All rights reserved. 本站由 Helay 纯手工打造. 蜀ICP备15017444号