广告
返回顶部
首页 > 资讯 > 后端开发 > PHP编程 >CentOS_7.9_x64编译安装php_8.1.12
  • 719
分享到

CentOS_7.9_x64编译安装php_8.1.12

centosphplinux 2023-09-20 20:09:29 719人浏览 薄情痞子
摘要

安装系统包 # yum install -y GCc gcc-c++ autoconf libtool bzip2 bzip-devel make python3 python3-devel 安装扩展依赖包 1 安装Openssl-1.1.

安装系统包

# yum install -y GCc gcc-c++ autoconf libtool bzip2 bzip-devel make python3 python3-devel

安装扩展依赖包

1 安装Openssl-1.1.1s

下载地址:https://www.openssl.org/source/openssl-1.1.1s.tar.gz

# tar zxvf openssl-1.1.1s.tar.gz# cd openssl-1.1.1s# ./config --prefix=/usr/local/openssl# make# make install# cd ..# openssl versionOpenSSL 1.0.2k-fips  26 Jan 2017# mv /usr/bin/openssl /usr/bin/openssl.bak# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl# echo "/usr/local/openssl/lib" >> /etc/ld.so.conf# echo "/usr/local/lib64" >> /etc/ld.so.conf# echo "/usr/local/lib" >> /etc/ld.so.conf# ldconfig -v# openssl version OpenSSL 1.1.1s  1 Nov 2022

2 安装perl-5.36.0

下载地址:https://www.cpan.org/src/5.0/perl-5.36.0.tar.gz

# tar zxvf perl-5.36.0.tar.gz# cd perl-5.36.0# ./Configure -des -Dprefix=/usr/local/perl# make# make install# cd ..# perl -vThis is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi(with 44 reGIStered patches, see perl -V for more detail)Copyright 1987-2012, Larry WallPerl may be copied only under the terms of either the Artistic License or theGNU General Public License, which may be found in the Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should be found onthis system using "man perl" or "perldoc perl".  If you have access to theInternet, point your browser at Http://www.perl.org/, the Perl Home Page.# mv /usr/bin/perl /usr/bin/perl.bak# ln -s /usr/local/perl/bin/perl /usr/bin/perl# perl -vThis is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linuxCopyright 1987-2022, Larry WallPerl may be copied only under the terms of either the Artistic License or theGNU General Public License, which may be found in the Perl 5 source kit.Complete documentation for Perl, including FAQ lists, should be found onthis system using "man perl" or "perldoc perl".  If you have access to theInternet, point your browser at https://www.perl.org/, the Perl Home Page.

3 安装zlib-1.2.13

下载地址:http://www.zlib.net/zlib-1.2.13.tar.gz

# tar zxvf zlib-1.2.13.tar.gz # cd zlib-1.2.13# ./configure --enable-shared# make# make install

4 安装libpng-1.6.39

下载:https://nchc.dl.sourceforge.net/project/libpng/libpng16/1.6.39/libpng-1.6.39.tar.gz

# tar zxvf libpng-1.6.39.tar.gz# cd libpng-1.6.39# ./configure --prefix=/usr/local/libpng --enable-shared# make# make install

5 安装jpeg-v9e

下载地址:http://www.ijg.org/files/jpegsrc.v9e.tar.gz

# tar zxvf jpegsrc.v9e.tar.gz# cd jpeg-9e# ./configure --prefix=/usr/local/jpeg-9e --enable-shared# make # make install# cd ..


2.6 安装xz-5.4.1

下载:https://nchc.dl.sourceforge.net/project/lzmautils/xz-5.4.1.tar.gz

# tar zxvf xz-5.4.1.tar.gz# cd xz-5.4.1# ./configure --prefix=/usr/local/xz --enable-shared# make# make install# cd ..

7 安装libxml2-2.9.12

下载:http://xmlsoft.org/sources/libxml2-2.9.12.tar.gz

# tar zxvf libxml2-2.9.12.tar.gz# cd libxml2-2.9.12# ./configure --prefix=/usr/local/libxml2 --with-zlib --with-lzma=/usr/local/zx# make# make install# cd ..

8 安装libxslt-1.1.34

下载: http://xmlsoft.org/sources/libxslt-1.1.34.tar.gz

# tar zxvf libxslt-1.1.34.tar.gz # cd libxslt-1.1.34# ./configure LD_LIBRARY_PATH=/usr/local/libxml2/lib PKG_CONFIG_PATH=/usr/local/libxml2/lib/pkgconfig --prefix=/usr/local/libxslt# make # make install# cd ..

9 安装freetype-2.12.1

下载:http://ftp.twaren.net/Unix/NonGNU/freetype/freetype-2.12.1.tar.gz

https://freedesktop.org/software/fontconfig/release/fontconfig-2.14.2.tar.gz

https://github.com/libgd/libgd/releases/download/gd-2.3.3/libgd-2.3.3.tar.gz

http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.17.tar.gz

https://github.com/curl/curl/releases/download/curl-7_83_1/curl-7.83.1.tar.gz

https://github.com/libexpat/libexpat/releases/download/R_2_4_9/expat-2.4.9.tar.gz

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-2.el7.x86_64.rpm

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-6.8.2-2.el7.x86_64.rpm

安装PHP-8.1.12

# yum -y install gcc gcc-c++ autoconf libtool perl-devel libpng-devel libjpeg-devel libcurl-devel openldap-devel  freetype-devel libxml2-devel sqlite-devel zlib-devel curl-devel pcre-devel gd-devel expat-devel libicu-devel bzip2 bzip2-devel Python3 python3-devel libiconv libiconv-devel libWEBp-devel# rpm -ivh oniguruma-6.8.2-2.el7.x86_64.rpm# rpm -ivh oniguruma-devel-6.8.2-2.el7.x86_64.rpm# yum install epel-release# yum install -y libzstd-devel# cp -frp /usr/lib64/libldap* /usr/lib/# groupadd Nginx# useradd -g nginx nginx -s /sbin/nologin -M# tar zxvf php-8.1.12.tar.gz# cd php-8.1.12# ./configure --prefix=/usr/local/php8.1 --with-config-file-path=/usr/local/php8.1/etc  --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx  --with-openssl --with-Mysqli --with-pdo-mysql --enable-mysqlnd --enable-mysqlnd-compression-support --enable-gd --enable-gd-jis-conv --with-freetype --with-jpeg --with-xpm --with-webp --with-zlib --with-zip --with-bz2 --with-libxml --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --with-curl --with-iconv --enable-mbregex --enable-mbstring --enable-intl --enable-ftp --with-mhash --enable-pcntl --enable-opcache --enable-Sockets --enable-soap --with-gettext --disable-fileinfo --disable-rpath --enable-debug --with-pear --with-ldap --with-expat --enable-phpdbg --enable-php-debug# make..............Generating phar.phpGenerating phar.pharPEAR package PHP_ArcHive not installed: generated phar will require PHP's phar extension be enabled.directorytreeiterator.incclicommand.incdirectorygraphiterator.incphar.incinvertedregexiterator.incpharcommand.incBuild complete.Don't forget to run 'make test'.# make installInstalling shared extensions:     /usr/local/php8.1/lib/php/extensions/debug-non-zts-20210902/Installing PHP CLI binary:        /usr/local/php8.1/bin/Installing PHP CLI man page:      /usr/local/php8.1/php/man/man1/Installing PHP FPM binary:        /usr/local/php8.1/sbin/Installing PHP FPM defconfig:     /usr/local/php8.1/etc/Installing PHP FPM man page:      /usr/local/php8.1/php/man/man8/Installing PHP FPM status page:   /usr/local/php8.1/php/php/fpm/Installing phpdbg binary:         /usr/local/php8.1/bin/Installing phpdbg man page:       /usr/local/php8.1/php/man/man1/Installing PHP CGI binary:        /usr/local/php8.1/bin/Installing PHP CGI man page:      /usr/local/php8.1/php/man/man1/Installing build environment:     /usr/local/php8.1/lib/php/build/Installing header files:          /usr/local/php8.1/include/php/Installing helper programs:       /usr/local/php8.1/bin/  program: phpize  program: php-configInstalling man pages:             /usr/local/php8.1/php/man/man1/  page: phpize.1  page: php-config.1Installing PEAR environment:      /usr/local/php8.1/lib/php/[PEAR] Archive_Tar    - installed: 1.4.14[PEAR] Console_Getopt - installed: 1.4.3[PEAR] Structures_Graph- installed: 1.1.1[PEAR] XML_Util       - installed: 1.4.5warning: pear/PEAR dependency package "pear/Archive_Tar" installed version 1.4.14 is not the recommended version 1.4.4[PEAR] PEAR           - installed: 1.10.13Wrote PEAR system config file at: /usr/local/php8.1/etc/pear.confYou may want to add: /usr/local/php8.1/lib/php to your php.ini include_path/usr/local/src/php-8.1.12/build/shtool install -c ext/phar/phar.phar /usr/local/php8.1/bin/phar.pharln -s -f phar.phar /usr/local/php8.1/bin/pharInstalling PDO headers:           /usr/local/php8.1/include/php/ext/pdo/# cp php.ini-development /usr/local/php8.1/etc/php.ini# cd /usr/local/php8.1/etc/# cp php-fpm.conf.default php-fpm.conf# cd php-fpm.d/# cp www.conf.default www.conf# cd ../../sbin# ./php-fpm# ps -ef|grep phproot     101463      1  0 23:52 ?        00:00:00 php-fpm: master process (/usr/local/php8.1/etc/php-fpm.conf)nginx    101464 101463  0 23:52 ?        00:00:00 php-fpm: pool wwwnginx    101465 101463  0 23:52 ?        00:00:00 php-fpm: pool wwwroot     101467   1497  0 23:52 pts/0    00:00:00 grep --color=auto php

问题解决记录

1 安装libxml2,make时报错

libxml.c:15:20: 致命错误:Python.h:没有那个文件或目录
 #include
                    ^
编译中断。
make[4]: *** [libxml.lo] 错误 1
安装python3

# yum install -y python3 python3-devel

继续make 通过

遇到错误
/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol 'ber_strdup' 
//usr/lib64/liblber-2.4.so.2: error adding symbols: DSO missing from command line 
collect2: error: ld returned 1 exit status 
make: *** [sapi/cli/php] Error 1
解决方案:
在PHP源码目录下 vi Makefile 找到 EXTRA_LIBS 行,在行末添加 ‘ -llber ‘ 保存退出再次make即可

来源地址:https://blog.csdn.net/sagitta421/article/details/128865021

--结束END--

本文标题: CentOS_7.9_x64编译安装php_8.1.12

本文链接: https://www.lsjlt.com/news/413335.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • CentOS_7.9_x64编译安装php_8.1.12
    安装系统包 # yum install -y gcc gcc-c++ autoconf libtool bzip2 bzip-devel make python3 python3-devel 安装扩展依赖包 1 安装Openssl-1.1....
    99+
    2023-09-20
    centos php linux
  • 编译安装python
    简介 Python(英语发音:/paθn/), 是一种面向对象、解释型计算机程序设计语言,由Guido van Rossum于1989年底发明,第一个公开发行版发行于1991年,Python 源代码同样遵循 GPL(GNU General ...
    99+
    2023-01-31
    python
  • Python编译安装
    一、安装依赖库yum install zlib zlib-devel -y二、安装openssl(如果无法下载安装包,请×××,你懂得)mkdir /usr/local/openssl && cd /usr/local/op...
    99+
    2023-01-31
    Python
  • MySQL编译安装
    MySQL编译安装 安装依赖环境 yum -y groupinstall "Development Tools"yum -y install ncurses ncurses-devel openssl...
    99+
    2023-09-23
    mysql 数据库 linux
  • 编译安装MySQL8.0
    MySQL 8.0 正式版 8.0.11 已发布,官方表示 MySQL 8 要比 MySQL 5.7 快 2 倍,还带来了大量的改进和更快的性能!注意:从 MySQL 5.7 升级到 MySQL 8.0 仅...
    99+
    2022-10-18
  • LAMP编译安装
    安装之前首先要安装所需的依赖库,将httpd mysql php等所需要的源码包上传到主机,或者wget 方式直接下载 上传方式和wget下载不作介绍,其中有些依赖是可以编译安装或者yum安装,并且这里依赖...
    99+
    2022-10-18
  • MySQL5.5.52编译安装
    一、MySQL介绍MySQL是一个关系型数据库管理系统,由瑞典MySQL AB 公司开发,目前属于 Oracle 旗下公司。MySQL 最流行的关系型数据库管理系统,在 WEB 应用方面MySQL是最好的 ...
    99+
    2022-10-18
  • mysql5.6.42--编译安装
    一、安装环境Centos6.5 64位 二、编译安装前的准备卸载老版本:#rpm -qa | grep -i mysql#rpm -ev --nodeps mysql-libs-5.1.73-8.el6_...
    99+
    2022-10-18
  • PostgreSQL编译安装
    PostgreSQL编译安装一、PostgreSQL简介 PostgreSQL是目前功能最强大的开源数据库,支持丰富的数据类型和自定义类型,且它提供了丰富的接口,可以轻易的扩展它的功能。 ...
    99+
    2022-10-18
  • mysql5.6.35编译安装
    安装前,先确保本地的mysql已经被卸载:rpm -e mysql   //普通删除模式 rpm -e --nodeps my...
    99+
    2022-10-18
  • Aerospike编译安装
    下载Aerospike Server社区版 wget -O aerospike.tgz "https://www.aerospike.com/download/server/latest/artifact/tgz" # 解压 tar -xv...
    99+
    2021-09-25
    Aerospike编译安装
  • apache编译安装
    下载[root@localhost mysql]# cd /usr/local/src/[root@localhost src]# wget http://syslab.comsenz.com/downlo...
    99+
    2022-10-18
  • golang编译安装
    随着越来越多的企业开始采用golang作为应用程序开发的首选语言,golang的使用越来越广泛。但是,对于一些没有使用过golang的开发人员来说,安装和配置golang可能会有一些棘手的问题。在本篇文章中,我们将重点介绍如何在不同平台上进...
    99+
    2023-05-19
  • php编译安装
     1.安装依赖 (我也是百度搜索的) yum -y install libxml2 libxml2-devel openssl openssl-devel curl-devel libjpeg-devel libpng-devel free...
    99+
    2023-09-05
    php linux 服务器
  • MySQL 5.5.32 编译安装
    1、安装环境准备 # wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo # y...
    99+
    2022-10-18
  • AliSQL-5.6.32编译安装
    1、系统环境 CentOS 6.8_X64 2、需要的软件mirrors-alisql-master.zip 以及需要的依赖包centos-release-scl devtoolset-4-gcc-c+...
    99+
    2022-10-18
  • LAMP编译安装1
    ...
    99+
    2022-10-18
  • zabbix 3.2 编译安装
    安装平台 centos 6.8 2.6.32-642.el6.x86_64关闭防火墙和selinux软件版本 apr-1.5.2 apr-util-1.5.4 pcre-8.39 httpd-2....
    99+
    2022-10-18
  • RedHat编译安装MySQL
    1、下载mysql源码压缩包,以及cmake的rpm包:boost_1_59_0.tar.gzmysql-5.7.19.tar.gzcmake-2.8.12.2-4.el6.x86_64.rpm2、解压压缩...
    99+
    2022-10-18
  • 编译安装zabbix3.2,LAMP
    编译安装zabbix方式1.1 环境准备系统环境:redhat 6.6 64位mysql-5.6.34php-5.6.28zabbix-3.2.1配置前先关闭iptables和SELINUX,避免安装过程中...
    99+
    2022-10-18
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作