编译php8,php8.0源码编译安装之尝鲜篇

下载 php8源码包

wget https://www.php.net/distributions/php-8.0.0.tar.gz

安装 依赖

新建用户

userdel www

groupadd www

useradd -g www -M -d /data/www -s /sbin/nologin www &> /dev/null

yum -y install wget vim pcre pcre-devel openssl openssl-devel libicu-devel gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses ncurses-devel curl curl-devel krb5-devel libidn libidn-devel openldap openldap-devel nss_ldap jemalloc-devel cmake boost-devel bison automake libevent libevent-devel gd gd-devel libtool* libmcrypt libmcrypt-devel mcrypt mhash libxslt libxslt-devel readline readline-devel gmp gmp-devel libcurl libcurl-devel openjpeg-devel sqlite-devel

编译和安装

./configure --prefix=/usr/local/php8 \

--with-config-file-path=/usr/local/php8 \

--enable-mbstring \

--enable-ftp \

--enable-gd \

--enable-gd-jis-conv \

--enable-mysqlnd \

--enable-pdo \

--enable-sockets \

--enable-fpm \

--enable-xml \

--enable-soap \

--enable-pcntl \

--enable-cli \

--with-openssl \

--with-mysqli=mysqlnd \

--with-pdo-mysql=mysqlnd \

--with-pear \

--with-zlib \

--with-iconv \

--with-curl \

--build=arm-linux && make && make install

测试

[root@localhost]# /usr/local/php8/bin/php -v

PHP 8.0.0 (cli) (built: Nov 27 2020 14:33:50) ( NTS )

Copyright (c) The PHP Group

Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies

完毕!

你可能感兴趣的:(编译php8)