首页 > 系统相关 >centos7编译安装php8

centos7编译安装php8

时间:2023-12-24 14:22:24浏览次数:47  
标签:status creating -- devel centos7 编译 php8 php config

参考推荐:https://blog.csdn.net/zzz1502/article/details/120157436

 

首先安装需要的依赖和第三方库

# yum install -y --setopt=protected_multilib=false gcGc gcc-c++ make cmake automake autoconf gd file bison patch mlocate flex diffutils zlib zlib-devel pcre pcre-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel libcurl libcurl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel kernel-devel libtool-libs readline-devel gettext-devel libcap-devel php-mcrypt libmcrypt libmcrypt-devel recode-devel sqlite-devel oniguruma oniguruma-devel libzip libzip-devel openssl-devel sqlite-devel

到PHP下载页面https://www.php.net/downloads.php

下载php源码

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

解压缩文件

# tar -xzvf  php-8.3.1.tar.gz

解压完成进入文件夹

# cd php-8.3

编译安装

# ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-mysqli=shared,mysqlnd --with-pdo-mysql --enable-opcache --enable-gd --with-iconv  --with-zip --enable-inline-optimization --disable-debug --disable-rpath --enable-shared --enable-xml --enable-bcmath --enable-shmop --enable-sysvsem --enable-mbregex --enable-mbstring --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --without-pear --with-gettext --enable-session --with-curl --with-jpeg --with-freetype --enable-fpm --with-fpm-user=nginx --with-fpm-group=nginx --without-gdbm --enable-fast-install --disable-fileinfo --enable-bcmath --with-openssl

编译过程中可能会报错,排查错误一般多是第三方依赖库版本低,或者缺少依赖安装,

错误提示:

1、No package ‘oniguruma’ found

安装

# yum install -y epel-release
# yum install -y oniguruma oniguruma-devel

2 .Requested ‘libzip >= 0.11’ but version of libzip is 0.10.1 libzip 版本太低

	yum remove libzip libzip-devel
	wget https://libzip.org/download/libzip-1.2.0.tar.gz
	tar -zxvf libzip-1.2.0.tar.gz
	cd libzip-1.2.0
	./configure
	make && make install
	export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig/"

  重新执行 ./configure

执行完成后继续执行

# make && make install

出现如下提示信息代表安装成功

Generating files
configure: patching main/php_config.h.in
configure: creating ./config.status
creating main/internal_functions.c
creating main/internal_functions_cli.c
config.status: creating main/build-defs.h
config.status: creating scripts/phpize
config.status: creating scripts/man1/phpize.1
config.status: creating scripts/php-config
config.status: creating scripts/man1/php-config.1
config.status: creating sapi/cli/php.1
config.status: creating sapi/fpm/php-fpm.conf
config.status: creating sapi/fpm/www.conf
config.status: creating sapi/fpm/init.d.php-fpm
config.status: creating sapi/fpm/php-fpm.service
config.status: creating sapi/fpm/php-fpm.8
config.status: creating sapi/fpm/status.html
config.status: creating sapi/phpdbg/phpdbg.1
config.status: creating sapi/cgi/php-cgi.1
config.status: creating ext/phar/phar.1
config.status: creating ext/phar/phar.phar.1
config.status: creating main/php_config.h
config.status: executing default commands

+--------------------------------------------------------------------+
| License:                                                           |
| This software is subject to the PHP License, available in this     |
| distribution in the file LICENSE. By continuing this installation  |
| process, you are bound by the terms of this license agreement.     |
| If you do not agree with the terms of this license, you must abort |
| the installation process at this point.                            |
+--------------------------------------------------------------------+

Thank you for using PHP.

configure: WARNING: unrecognized options: --enable-inline-optimization, --with-xmlrpc

  

 

标签:status,creating,--,devel,centos7,编译,php8,php,config
From: https://www.cnblogs.com/haoxuanchen2014/p/17924345.html

相关文章

  • centos7安装nginx
    首先安装nginx所需要的第三方库和编译工具# yuminstall-ygccgcc-c++autoconfautomakemake# yuminstallzlibzlib-developensslopenssl-develpcrepcre-develwgethttpd-toolsvim-ynginx官网:https://nginx.org/进入download页面下载稳定版本Stableversion:下......
  • keystone和beaengine的编译
    编译Keystone根据github的文档编译不出来,所以还是用CMake项目转成VisualStudio的项目来编译1、下载源码https://github.com/keystone-engine/keystoneclone或者直接下载zip都行2、CMake创建VisualStudio项目下载和安装CMake就不细说了,在官网下载cmake-3.28.0-windows-x86_6......
  • keystone和beaengine的编译
    编译Keystone根据github的文档编译不出来,所以还是用CMake项目转成VisualStudio的项目来编译1、下载源码https://github.com/keystone-engine/keystoneclone或者直接下载zip都行2、CMake创建VisualStudio项目下载和安装CMake就不细说了,在官网下载cmake-3.28.0-windows-x86_......
  • 二三、编译器
    二三、编译器1、OneDefinitionRule1)转化单元我们写好的每个源文件(.cpp,.c)将其所包含的头文件(#include<xxx.h>)合并后,称为一个转化单元。编译器单独的将每一个转化单元生成为对应的对象文件(.obj),对象文件包含了转化单元的机器码和转化单元的引用信息(不在转化单元中定义的对象)......
  • Ubuntu 22.04.3 LTS 编译 OpenJDK 12
    基于《深入理解Java虚拟机》第3版1.配置环境更新软件源sudoaptupdate获取源码wgethttps://hg.openjdk.org/jdk/jdk12/archive/06222165c35f.zip构建基础编译环境sudoaptinstallbuild-essential此处安装的gcc及g++的版本为11,需要替换为7。参考这个......
  • 编译期注解开发指北
    前言可用于基于注解的工具类开发,主要用于代码生成及相关配套技术明星项目:Lombok示例项目:diy-lombok开发流程明确开发目标:代码生成只是一种中间手段,最终必然落到某个具体需求上,非必要不生成自定义注解开发自定义注解器开发Debug基于日志作为SDK集成到Spring项目......
  • FOG Project的 FOS 编译
    FOGProject系统是一个免费的开源计算机网络克隆和管理解决方案系统,与传统的Ghost有很大的不同,如果您是计算机维护管理人员,当有大量机器需要同时部署上线的时候FOGProject是一个可以大大提高工作效率的系统,支持windows、Linux等操作系统,包括引导方式也支持UEFI方式进行引导。FO......
  • centos7_mysql_删除
    CentOS7中的MySQL是使用以下命令进行安装的:sudoyuminstallmysql-server以下是如何完全卸载MySQL的步骤:步骤1:停止MySQL服务sudosystemctlstopmysqld.service步骤2:禁用MySQL服务,使它不会在系统重启时启动sudosystemctldisablemysqld.service步骤3:卸......
  • K2 sherpa编译使用
    编译安装pip卸载cmake、torch、k2安装cmake3.22.3版本、k2、kaldi_feat【官方提供|install_dir】、torch==2.0.1【】缺cudaexportLD_LIBRARY_PATH=/usr/local/cuda11.7/lib64:$LD_LIBRARY_PATHexportPATH=/usr/local/cuda11.7/include:/usr/local/cuda11.7/bin:$PATH#......
  • 《TVM编译器原理与实践》新书推荐
    《TVM编译器原理与实践》新书推荐作者:吴建明,吴一昊;出版社:机械工业出版社;出版时间:2023年12月 本书已经出版,目前在淘宝天猫,京东,当当上可以购买。谢谢!天猫:https://detail.tmall.com/item.htm?abbucket=8&id=757068341348&ns=1&spm=a21n57.1.0.0.2b9b523ckBk0aH京东:https://it......