美文网首页
CentOS7源码安装php7.3

CentOS7源码安装php7.3

作者: 我_bacd | 来源:发表于2019-09-27 11:27 被阅读0次

一、前期准备

1、更新yum

yum -y update

2、安装依赖

yum -y install libxml2 libxml2-devel openssl openssl-devel bzip2 bzip2-devel libcurl libcurl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel gmp gmp-devel libmcrypt libmcrypt-devel readline readline-devel libxslt libxslt-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel ncurses curl gdbm-devel db4-devel libXpm-devel libX11-devel gd-devel gmp-devel expat-devel xmlrpc-c xmlrpc-c-devel libicu-devel libmcrypt-devel libmemcached-devel libzip gcc-c++

3、安装cmake

// 下载安装包至 /usr/local/src 目录下
wget https://github.com/Kitware/CMake/releases/download/v3.14.3/cmake-3.14.3.tar.gz -P /usr/local/src
// 解压并进入解压后目录
cd /usr/local/src
tar -zxvf cmake-3.14.3.tar.gz
cd cmake-3.14.3
// 安装(需要一小段时间,耐心等待)
./bootstrap
make
make install

4、卸载旧版libzip,安装新版libzip

此操作可解决php7.3编译错误 configure: error: Please reinstall the libzip distribution

// 卸载旧版libzip
yum -y remove libzip
// 下载新版libzip至 /usr/local/src 目录下
wget https://libzip.org/download/libzip-1.5.2.tar.gz -P /usr/local/src
// 解压并进入解压后目录
cd /usr/local/src
tar -zxvf libzip-1.5.2.tar.gz
cd libzip-1.5.2
// 创建 build 文件夹并进入
mkdir build
cd build
// cmake .. (注意cmake命令后的两个英文点)
cmake ..
make
make install

5、动态函数库加载的配置新版 lib

此操作可解决php7.3编译错误 error: off_t undefined; check your library configuration

vi /etc/ld.so.conf
// 添加下面几行,如图 5-1
/usr/local/lib64
/usr/local/lib
/usr/lib
/usr/lib64
5-1
// 更新配置
ldconfig -v

2、下载安装php7.3

1、下载安装php7.3

// 下载php7.3至 /usr/local/src
wget https://www.php.net/distributions/php-7.3.9.tar.gz -P /usr/local/src
// 解压并进入文件夹
cd /usr/local/src
tar -zxvf php-7.3.9.tar.gz
cd php-7.3.9
// 编译
./configure \
 --prefix=/usr/local/php\
 --enable-fpm\
 --with-fpm-user=www\
 --with-fpm-group=www\
 --with-config-file-path=/usr/local/php/conf\
 --disable-rpath\
 --enable-soap\
 --with-libxml-dir\
 --with-xmlrpc\
 --with-openssl\
 --with-mhash\
 --with-pcre-regex\
 --with-zlib\
 --enable-bcmath\
 --with-bz2\
 --enable-calendar\
 --with-curl\
 --enable-exif\
 --with-pcre-dir\
 --enable-ftp\
 --with-gd\
 --with-openssl-dir\
 --with-jpeg-dir\
 --with-png-dir\
 --with-zlib-dir\
 --with-freetype-dir\
 --enable-gd-jis-conv\
 --with-gettext\
 --with-gmp\
 --with-mhash\
 --enable-mbstring\
 --with-onig\
 --with-mysqli=mysqlnd\
 --with-pdo-mysql=mysqlnd\
 --with-zlib-dir\
 --with-readline\
 --enable-shmop\
 --enable-sockets\
 --enable-sysvmsg\
 --enable-sysvsem \
 --enable-sysvshm \
 --enable-wddx\
 --with-libxml-dir\
 --with-xsl\
 --enable-zip\
 --with-pear
// 安装
make
make install

2、复制生成配置文件

cp /usr/local/src/php-7.3.9/php.ini-production /usr/local/php/conf/php.ini
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf

3、编辑 /etc/profile 文件,配置环境变量

// 编辑配置文件
vi /etc/profile
// 添加下面内容
php=/usr/local/php/bin
PATH=$PATH:$php
export PATH
2-1
// 保存并退出编辑后,执行 srource /etc/profile 使配置文件生效
source /etc/profile

相关文章

  • DOCKER----安装php集成环境

    环境:centos7 安装:php7.3 、nginx1.18.0 、redis5.0 、mysql8.0 1.拉...

  • CentOS7源码安装php7.3

    一、前期准备 1、更新yum 2、安装依赖 3、安装cmake 4、卸载旧版libzip,安装新版libzip 此...

  • php7.4分享

    php7.3, php7.4相关介绍 [toc] mac本地 php7.4源码安装 可能提前需要安装 re2c, ...

  • Centos7 多种方法 安装git

    源码安装 安装对应的依赖 下载源码编译安装 确保系统git 已经被卸载 rpm 安装(基于CentOS7)

  • Python基础知识

    Python下载地址:官方源码 centos7下安装方法 :Centos7安装Python3.5 Python B...

  • VPP基本安装

    以下安装方式在centos7上安装测试(可用)有三种安装方式:源码安装、yum安装、vpp-config安装 源码...

  • CentOS7上安装Nodejs

    CentOS7上安装Nodejs 下载源码 解压源码,并重命名源码 编译安装 配置NODE_HOME,进入prof...

  • PHP7.3 yum安装@Centos 7

    PHP7.3 yum安装@Centos 7 发布者:itgeeker2019-01-08于PHP7.3 yum安装...

  • CentOS7安装Tomcat8

    1 、安装说明 安装环境:CentOS7安装方式:源码安装软件:apache-tomcat-8.0.39-src....

  • centos7源码安装redis-5.0.0vv

    centos7源码安装redis-5.0.0 1.下载redis源码包 [root@localhostlocal]...

网友评论

      本文标题:CentOS7源码安装php7.3

      本文链接:https://www.haomeiwen.com/subject/wkiquctx.html