安装php7.2出现错误

configure: error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution

yum install -y libxslt-devel*

PHP报错:Configure: error: freetype.h not found

yum install freetype-devel

configure: error: png.h not found.

yum install libpng

yum install libpng-devel

configure: error: jpeglib.h not found.

yum -y install libjpeg-devel

error:Please reinstall the BZip2 distribution

yum install bzip2 bzip2-devel

yum -y  install  gcc  gcc-c++ libxml2-devel m4 autoconf pcre-devel make cmake bison openssl openssl-devel

yum install libcurl-devel
yum install openldap openldap-devel openldap-servers openldap-client

7.3 编译安装

[root@localhost ~]# yum -y install wget 
[root@localhost ~]# wget -c https://www.php.net/distributions/php-7.3.12.tar.gz [root@localhost ~]# ls 
[root@localhost ~]# tar -xzvf php-7.3.12.tar.gz 
[root@localhost ~]# yum -y install libxml2 
[root@localhost ~]# yum -y install libxml2-devel 
#需要执行一下因为有些系统不一的关系 [root@localhost ~]# yum -y install openssl 
[root@localhost ~]# yum -y install openssl-devel 
[root@localhost ~]# yum -y install curl 
[root@localhost ~]# yum -y install curl-devel 
[root@localhost ~]# yum -y install libjpeg 
[root@localhost ~]# yum -y install libjpeg-devel 
[root@localhost ~]# yum -y install libpng 
[root@localhost ~]# yum -y install libpng-devel 
[root@localhost ~]# yum -y install freetype 
[root@localhost ~]# yum -y install freetype-devel 
[root@localhost ~]# yum -y install pcre 
[root@localhost ~]# yum -y install pcre-devel 
[root@localhost ~]# yum -y install libxslt 
[root@localhost ~]# yum -y install libxslt-devel 
[root@localhost ~]# yum -y install bzip2 
[root@localhost ~]# yum -y install bzip2-devel
[root@localhost ~]# yum remove libzip 
[root@localhost ~]# cd /www 
[root@localhost ~]# wget https://nih.at/libzip/libzip-1.2.0.tar.gz 
[root@localhost ~]# tar -zxvf libzip-1.2.0.tar.gz 
[root@localhost ~]# cd libzip-1.2.0 
[root@localhost ~]# ./configure 
[root@localhost ~]# make -j4 && make install

[root@localhost ~]# vi /etc/ld.so.conf 
#添加如下几行 
/usr/local/lib64 
/usr/local/lib 
/usr/lib 
/usr/lib64 
#按 esc 保存退出

[root@localhost ~]# find / -name zipconf.h 
[root@localhost ~]# cp /usr/local/lib/libzip/include/zipconf.h /usr/local/include/zipconf.h



[root@localhost ~]# make clear 
[root@localhost ~]# make install 
[root@localhost ~]# cp php.ini-development /usr/local/php/lib/php.ini 
[root@localhost ~]# cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf 
[root@localhost ~]# ln -s /usr/local/php/sbin/php-fpm /usr/local/bin 
[root@localhost ~]# groupadd www 
[root@localhost ~]# useradd -g www www 
[root@localhost ~]# cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf 
[root@localhost ~]# vi /usr/local/php/etc/php-fpm.d/www.conf 
#修改如下内容 
user=www 
group=www


[root@localhost ~]# vi /usr/local/php/lib/php.ini 

#修改如下内容 
cgi.fix_pathinfo=0 
[root@localhost ~]# /usr/local/bin/php-fpm 
[root@localhost ~]# yum install net-tools 
[root@localhost php-fpm.d]# netstat -tln | grep 9000 tcp 0 0 127.0.0.1:9000 0.0.0.0:* LISTEN [root@localhost php-fpm.d]# ps -aux | grep php root 67971 0.0 0.3 231268 6560 ? Ss 15:24 0:00 php-fpm: master process (/usr/local/ph/etc/php-fpm.conf) www 67972 0.0 0.3 231268 6100 ? S 15:24 0:00 php-fpm: pool www www 67973 0.0 0.3 231268 6100 ? S 15:24 0:00 php-fpm: pool www root 67998 0.0 0.0 112732 976 pts/0 S+ 15:24 0:00 grep --color=auto php 
[root@localhost ~]# vi /etc/profile 
export PATH="$PATH:/usr/local/php/bin" 

[root@localhost ~]# source /etc/profile 
[root@localhost php]# php -v PHP 7.3.12 (cli) (built: Nov 27 2019 15:11:15) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.12, Copyright (c) 1998-2018 Zend Technologies

安装7.2

Wget  http://cn2.php.net/distributions/php-7.2.15.tar.gz
./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-curl --with-freetype-dir --with-gd --with-gettext --with-iconv-dir --with-kerberos --with-libdir=lib64 --with-libxml-dir --with-mysqli --with-openssl --with-pcre-regex --with-pdo-mysql --with-pdo-sqlite --with-pear --with-png-dir --with-jpeg-dir --with-xmlrpc --with-xsl --with-zlib --with-bz2 --with-mhash --enable-fpm --enable-bcmath --enable-libxml --enable-inline-optimization --enable-mbregex --enable-mbstring --enable-opcache --enable-pcntl --enable-shmop --enable-soap --enable-sockets --enable-sysvsem --enable-sysvshm --enable-xml --enable-zip --enable-shared --disable-debug --disable-rpath --enable-session
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

伟伟哦

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值