学习笔记0507----LAMP架构

LAMP架构学习

预习内容

11.1 LAMP架构介绍
11.2 MySQL、MariaDB介绍
11.3/11.4/11.5 MySQL安装
11.6 MariaDB安装
11.7/11.8/11.9 Apache安装
11.10/11.11/11.12 安装PHP5
11.13 安装PHP7
11.14/11.15 Apache和PHP结合
扩展
mysql5.5源码编译安装 http://www.aminglinux.com/bbs/thread-1059-1-1.html
mysql5.7二进制包安装(变化较大) http://www.apelearn.com/bbs/thread-10105-1-1.html
apache dso https://yq.aliyun.com/articles/6298
apache apxs https://wizardforcel.gitbooks.io/apache-doc/content/51.html
apache工作模式 http://www.cnblogs.com/fnng/archive/2012/11/20/2779977.html
php中mysql,mysqli,mysqlnd,pdo到底是什么 http://blog.csdn.net/u013785951/article/details/60876816
查看编译参数 http://ask.apelearn.com/question/1295

1.LAMP架构介绍

LAMP:Linux+Apache(httpd)+Maridb(Mysql)+PHP,常用来搭建动态网站或者服务器的开源软件。
在这里插入图片描述

习惯上,apache一般是指httpd,当然Apache还有很多的其他软件。Appache是最常用的web服务软件,而MYSQL是比较小型的数据库软件,MySQL存储用户名;密码和数据、图片之类的放在静态文件里。 这两个软件及PHP都可以安装到windows机器上。

Apache和PHP需要安装到同一台机器上,因为PHP是作为Apache的一个模块存在的,两个必须在一起。
在这里插入图片描述

LAMP架构介绍

2.mysql 5.6.43二进制编码包安装

2.1 下载mysql的二进制编码包

[root@linux-001 ~]# cd /usr/local/src/
[root@linux-001 src]# wget http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz
--2019-05-06 19:29:15--  http://mirrors.163.com/mysql/Downloads/MySQL-5.6/mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz
正在解析主机 mirrors.163.com (mirrors.163.com)... 59.111.0.251
正在连接 mirrors.163.com (mirrors.163.com)|59.111.0.251|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:328740156 (314M) [application/octet-stream]
正在保存至: “mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz”

100%[===========================================================================================>] 328,740,156 4.66MB/s 用时 2m 8s  

2019-05-06 19:31:23 (2.44 MB/s) - 已保存 “mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz” [328740156/328740156])

2.2 解打包压缩文件

[root@linux-001 src]# tar -zxvf  mysql-5.6.43-linux-glibc2.12-x86_64.tar.gz  
…………
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_install_db.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqld_safe.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqlimport.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_waitpid.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_config_editor.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqldump.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_plugin.1
mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_find_rows.1

2.3 复制文件到/usr/local/mysql

[root@linux-001 src]# mv mysql-5.6.43-linux-glibc2.12-x86_64 /usr/local/mysql

2.4 创建mysql用户和数据位置

[root@linux-001 mysql]# useradd mysql
[root@linux-001 mysql]# mkdir /data/

2.5 mysql初始化,安装perl-Data-Dumper.x86_64

## 此处报错,缺少perl模块和dumper的支持 ##
[root@linux-001 mysql]# ./scripts/mysql_install_db  --user=mysql --datadir=/data/mysql
FATAL ERROR: please install the following Perl modules before executing ./scripts/mysql_install_db:
Data::Dumper
[root@linux-001 mysql]# 
[root@linux-001 mysql]# yum list | grep perl |grep -i dumper
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
perl-Data-Dumper.x86_64                 2.145-3.el7                    base     
perl-Data-Dumper-Concise.noarch         2.020-6.el7                    epel     
perl-Data-Dumper-Names.noarch           0.03-17.el7                    epel     
perl-Data-TreeDumper.noarch             0.40-19.el7                    epel     
perl-XML-Dumper.noarch                  0.81-17.el7                    base     
[root@linux-001 mysql]# 
[root@linux-001 mysql]# yum install -y perl-Data-Dumper.x86_64
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
epel/x86_64/metalink                                                                                          | 6.7 kB  00:00:00     
 * base: mirrors.163.com
 * epel: fedora.cs.nctu.edu.tw
 * extras: ap.stykers.moe
 * updates: mirrors.163.com
base                                                                                                          | 3.6 kB  00:00:00     
epel                                                                                                          | 4.7 kB  00:00:00     
extras                                                                                                        | 3.4 kB  00:00:00     
updates                                                                                                       | 3.4 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                                                             | 201 kB  00:00:00     
(2/4): updates/7/x86_64/primary_db                                                                            | 4.2 MB  00:00:00     
(3/4): epel/x86_64/updateinfo                                                                                 | 992 kB  00:00:05     
(4/4): epel/x86_64/primary_db                                                                                 | 6.7 MB  00:02:24     
正在解决依赖关系
--> 正在检查事务
---> 软件包 perl-Data-Dumper.x86_64.0.2.145-3.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                               架构                        版本                              源                         大小
=====================================================================================================================================
正在安装:
 perl-Data-Dumper                      x86_64                      2.145-3.el7                       base                       47 k

事务概要
=====================================================================================================================================
安装  1 软件包

总下载量:47 k
安装大小:97 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
perl-Data-Dumper-2.145-3.el7.x86_64.rpm                                                                       |  47 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : perl-Data-Dumper-2.145-3.el7.x86_64                                                                              1/1 
  验证中      : perl-Data-Dumper-2.145-3.el7.x86_64                                                                              1/1 

已安装:
  perl-Data-Dumper.x86_64 0:2.145-3.el7                                                                                              

完毕!

[root@linux-001 mysql]# ./scripts/mysql_install_db  --user=mysql --datadir=/data/mysql
Installing MySQL system tables...2019-05-06 19:42:37 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-05-06 19:42:37 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2019-05-06 19:42:37 0 [Note] ./bin/mysqld (mysqld 5.6.43) starting as process 84040 ...
2019-05-06 19:42:37 84040 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-05-06 19:42:37 84040 [Note] InnoDB: The InnoDB memory heap is disabled
2019-05-06 19:42:37 84040 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-06 19:42:37 84040 [Note] InnoDB: Memory barrier is not used
2019-05-06 19:42:37 84040 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-05-06 19:42:37 84040 [Note] InnoDB: Using Linux native AIO
2019-05-06 19:42:37 84040 [Note] InnoDB: Using CPU crc32 instructions
2019-05-06 19:42:37 84040 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-05-06 19:42:37 84040 [Note] InnoDB: Completed initialization of buffer pool
2019-05-06 19:42:37 84040 [Note] InnoDB: The first specified data file ./ibdata1 did not exist: a new database to be created!
2019-05-06 19:42:37 84040 [Note] InnoDB: Setting file ./ibdata1 size to 12 MB
2019-05-06 19:42:37 84040 [Note] InnoDB: Database physically writes the file full: wait...
2019-05-06 19:42:37 84040 [Note] InnoDB: Setting log file ./ib_logfile101 size to 48 MB
2019-05-06 19:42:37 84040 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB
2019-05-06 19:42:37 84040 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0
2019-05-06 19:42:37 84040 [Warning] InnoDB: New log files created, LSN=45781
2019-05-06 19:42:37 84040 [Note] InnoDB: Doublewrite buffer not found: creating new
2019-05-06 19:42:37 84040 [Note] InnoDB: Doublewrite buffer created
2019-05-06 19:42:37 84040 [Note] InnoDB: 128 rollback segment(s) are active.
2019-05-06 19:42:37 84040 [Warning] InnoDB: Creating foreign key constraint system tables.
2019-05-06 19:42:37 84040 [Note] InnoDB: Foreign key constraint system tables created
2019-05-06 19:42:37 84040 [Note] InnoDB: Creating tablespace and datafile system tables.
2019-05-06 19:42:37 84040 [Note] InnoDB: Tablespace and datafile system tables created.
2019-05-06 19:42:37 84040 [Note] InnoDB: Waiting for purge to start
2019-05-06 19:42:37 84040 [Note] InnoDB: 5.6.43 started; log sequence number 0
2019-05-06 19:42:38 84040 [Note] Binlog end
2019-05-06 19:42:38 84040 [Note] InnoDB: FTS optimize thread exiting.
2019-05-06 19:42:38 84040 [Note] InnoDB: Starting shutdown...
2019-05-06 19:42:39 84040 [Note] InnoDB: Shutdown completed; log sequence number 1625977
OK

Filling help tables...2019-05-06 19:42:40 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-05-06 19:42:40 0 [Note] Ignoring --secure-file-priv value as server is running with --bootstrap.
2019-05-06 19:42:40 0 [Note] ./bin/mysqld (mysqld 5.6.43) starting as process 84064 ...
2019-05-06 19:42:40 84064 [Note] InnoDB: Using atomics to ref count buffer pool pages
2019-05-06 19:42:40 84064 [Note] InnoDB: The InnoDB memory heap is disabled
2019-05-06 19:42:40 84064 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2019-05-06 19:42:40 84064 [Note] InnoDB: Memory barrier is not used
2019-05-06 19:42:40 84064 [Note] InnoDB: Compressed tables use zlib 1.2.11
2019-05-06 19:42:40 84064 [Note] InnoDB: Using Linux native AIO
2019-05-06 19:42:40 84064 [Note] InnoDB: Using CPU crc32 instructions
2019-05-06 19:42:40 84064 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2019-05-06 19:42:40 84064 [Note] InnoDB: Completed initialization of buffer pool
2019-05-06 19:42:40 84064 [Note] InnoDB: Highest supported file format is Barracuda.
2019-05-06 19:42:40 84064 [Note] InnoDB: 128 rollback segment(s) are active.
2019-05-06 19:42:40 84064 [Note] InnoDB: Waiting for purge to start
2019-05-06 19:42:40 84064 [Note] InnoDB: 5.6.43 started; log sequence number 1625977
2019-05-06 19:42:40 84064 [Note] Binlog end
2019-05-06 19:42:40 84064 [Note] InnoDB: FTS optimize thread exiting.
2019-05-06 19:42:40 84064 [Note] InnoDB: Starting shutdown...
2019-05-06 19:42:42 84064 [Note] InnoDB: Shutdown completed; log sequence number 1625987
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h linux-001 password 'new-password'

Alternatively you can run:

  ./bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:

  cd . ; ./bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl

  cd mysql-test ; perl mysql-test-run.pl

Please report any problems at http://bugs.mysql.com/

The latest information about MySQL is available on the web at

  http://www.mysql.com

Support MySQL by buying support/licenses at http://shop.mysql.com

New default config file was created as ./my.cnf and
will be used by default by the server when you start it.
You may edit this file to change server settings

WARNING: Default config file /etc/my.cnf exists on the system
This file will be read by default by the MySQL server
If you do not want to use this, either remove it, or use the
--defaults-file argument to mysqld_safe when starting the server

[root@linux-001 mysql]# 
[root@linux-001 mysql]# echo $?
0

2.6 修改配置文件

可以复制 support-files/my-default.cnf 文件到 /etc/my.cnf ,也可以直接编辑my.cnf,系统中默认安装了mariadb-libs包。

[root@linux-001 mysql]# ls support-files/
binary-configure  magic  my-default.cnf  mysqld_multi.server  mysql-log-rotate  mysql.server
[root@linux-001 mysql]# vim support-files/my-default.cnf 
[root@linux-001 mysql]# ls /etc/my.cnf
/etc/my.cnf
[root@linux-001 mysql]# rpm -qf /etc/my.cnf
mariadb-libs-5.5.60-1.el7_5.x86_64
[root@linux-001 mysql]# vim /etc/my.cnf
[mysqld]
datadir=/data/mysql
socket=/tmp/mysql.sock
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
# Settings user and group are ignored when systemd is used.
# If you need to run mysqld under a different user or group,
# customize your systemd unit file for mariadb according to the
# instructions in http://fedoraproject.org/wiki/Systemd

[mysqld_safe]
#log-error=/var/log/mariadb/mariadb.log
#pid-file=/var/run/mariadb/mariadb.pid

#
# include all files from the config directory
#
#!includedir /etc/my.cnf.d

2.7 复制启动脚本,注意启动脚本的权限是755

[root@linux-001 mysql]# cp  support-files/mysql.server  /etc/init.d/mysql
[root@linux-001 mysql]# vim !$
vim /etc/init.d/mysql
.....
basedir=/usr/local/mysql //指定mysql 的程序目录
datadir=/data/mysql //指定日期目录
.....
[root@linux-001 mysql]# ll /etc/init.d/mysql 
-rwxr-xr-x 1 root root 10592 5月   6 19:49 /etc/init.d/mysql

2.8 可以把服务添加到系统列表

[root@linux-001 mysql]# chkconfig --add mysql
[root@linux-001 mysql]# chkconfig  --list

注:该输出结果只显示 SysV 服务,并不包含
原生 systemd 服务。SysV 配置数据
可能被原生 systemd 配置覆盖。 

      要列出 systemd 服务,请执行 'systemctl list-unit-files'。
      查看在具体 target 启用的服务请执行
      'systemctl list-dependencies [target]'。

mysql          	0:关	1:关	2:开	3:开	4:开	5:开	6:关
netconsole     	0:关	1:关	2:关	3:关	4:关	5:关	6:关
network        	0:关	1:关	2:开	3:开	4:开	5:开	6:关
[root@linux-001 mysql]# 

2.9 启动mysql服务

[root@linux-001 mysql]# service mysql start
Starting MySQL.Logging to '/data/mysql/linux-001.err'.
. SUCCESS! 
[root@linux-001 mysql]# ps aux|grep mysql
root      84848  0.0  0.0  11816  1628 pts/0    S    19:53   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/linux-001.pid
mysql     84986  7.0 24.1 1302736 449796 pts/0  Sl   19:53   0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=linux-001.err --pid-file=/data/mysql/linux-001.pid --socket=/tmp/mysql.sock
root      85029  0.0  0.0 112724   984 pts/0    R+   19:53   0:00 grep --color=auto mysql
[root@linux-001 mysql]# service mysql stop 
Shutting down MySQL..190506 20:01:01 mysqld_safe mysqld from pid file /data/mysql/linux-001.pid ended
 SUCCESS! 
[1]+  完成                  /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql/
[root@linux-001 mysql]# !ps
ps aux |grep mysql
root      85893  0.0  0.0 112724   984 pts/1    R+   20:01   0:00 grep --color=auto mysql
[root@linux-001 mysql]# 

2.10 使用命令启动

/usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql/ &
–defaults-file=/etc/my.cnf 指定启动的配置文件
–user=mysql 指定启动用户
–datadir=/data/mysql/ 指定启动数据存储位置

[root@linux-001 mysql]# /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql/ &
[1] 85529
[root@linux-001 mysql]# 190506 19:58:20 mysqld_safe Logging to '/data/mysql/linux-001.err'.
190506 19:58:20 mysqld_safe Starting mysqld daemon with databases from /data/mysql

[root@linux-001 mysql]# !ps
ps aux |grep mysql
root      85529  0.0  0.0 113308  1640 pts/1    S    19:58   0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --defaults-file=/etc/my.cnf --user=mysql --datadir=/data/mysql/
mysql     85663  0.4 24.1 1302736 449780 pts/1  Sl   19:58   0:00 /usr/local/mysql/bin/mysqld --defaults-file=/etc/my.cnf --basedir=/usr/local/mysql --datadir=/data/mysql --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=linux-001.err --pid-file=linux-001.pid --socket=/tmp/mysql.sock
root      85806  0.0  0.0 112724   988 pts/1    R+   20:00   0:00 grep --color=auto mysql
[root@linux-001 mysql]# 
[root@linux-001 mysql]# netstat  -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      27416/sshd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7003/master         
tcp6       0      0 :::3306                 :::*                    LISTEN      86158/mysqld        
tcp6       0      0 :::22                   :::*                    LISTEN      27416/sshd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      7003/master         
[root@linux-001 mysql]# 
[root@linux-001 mysql]# killall mysqld 
[root@linux-001 mysql]# ps aux|grep mysql
root      85098  0.0  0.0 112724   988 pts/0    R+   19:54   0:00 grep --color=auto mysql

补充:mysql的引擎innodb和 myisam 先了解

3.mariadb 10.2.23安装

mariadb的二进制安装和配置说明

3.1 下载mariadb的二进制编译包

在mariadb官网找mariadb二进制编译包(10.2版本的二进制编译包包含配置文件,10.3的包不包含配置文件);下载二进制编译包到 /usr/local/src/ 下

[root@linux-001 ~]# cd /usr/local/src/
[root@linux-001 src]# wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.23/bintar-linux-glibc_214-x86_64/mariadb-10.2.23-linux-glibc_214-x86_64.tar.gz
--2019-05-06 21:20:25--  https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.23/bintar-linux-glibc_214-x86_64/mariadb-10.2.23-linux-glibc_214-x86_64.tar.gz
正在解析主机 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
正在连接 mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:610755981 (582M) [application/x-gzip]
正在保存至: “mariadb-10.2.23-linux-glibc_214-x86_64.tar.gz”

100%[===========================================================================================>] 610,755,981 1.67MB/s 用时 6m 43s 

2019-05-06 21:27:13 (1.45 MB/s) - 已保存 “mariadb-10.2.23-linux-glibc_214-x86_64.tar.gz” [610755981/610755981])

3.2 解压缩二进制编译包

[root@linux-001 src]# tar -zxvf  mariadb-10.2.23-linux-glibc_214-x86_64.tar.gz
……
mariadb-10.2.23-linux-glibc_214-x86_64/README-wsrep
mariadb-10.2.23-linux-glibc_214-x86_64/INSTALL-BINARY
mariadb-10.2.23-linux-glibc_214-x86_64/EXCEPTIONS-CLIENT
mariadb-10.2.23-linux-glibc_214-x86_64/COPYING.thirdparty
mariadb-10.2.23-linux-glibc_214-x86_64/COPYING
mariadb-10.2.23-linux-glibc_214-x86_64/CREDITS
mariadb-10.2.23-linux-glibc_214-x86_64/README.md

3.3 移动解压后的包到 /usr/local/mariadb/ 下

[root@linux-001 src]# mv mariadb-10.2.23-linux-glibc_214-x86_64  /usr/local/mariadb
[root@linux-001 src]# cd !$
cd /usr/local/mariadb

3.4 修改配置文件

由于系统已经安装mysql,所以复制 support-files文件夹下的配置文件到 /usr/local/mariadb/my.cnf 下,若未安装mysql,可以复制配置文件到 /etc/my.cnf ,修改此配置文件,在mysqld配置段添加一行配置 datadir = /data/mariadb,不然启动mariadb服务,会自动找到mysql的datadir下,可以先不添加试试。
在这里插入图片描述

[root@linux-001 mariadb]# cp support-files/my-small.cnf   /usr/local/mariadb/my.cnf
[root@linux-001 mariadb]# vim /usr/local/mariadb/my.cnf

在这里插入图片描述

3.5 复制启动脚本

复制 support-files文件夹下mysql.service 到 /etc/init.d/mariadb ,需要修改配置文件中的basedir和datadir,需要添加一行conf =/usr/local/mariadb/my.cnf ,并且需要把start的位置处加–defaults-file="$conf" ;

[root@linux-001 mariadb]# cp support-files/mysql.server  /etc/init.d/mariadb

[root@linux-001 mariadb]# vim /etc/init.d/mariadb
……
basedir=/usr/local/mariadb
datadir=/data/mariadb
conf=/usr/local/mariadb/my.cnf
……
case "$mode" in
  'start')
    # Start daemon

    # Safeguard (relative paths, core dumps..)
    cd $basedir

    echo $echo_n "Starting MariaDB"
    if test -x $bindir/mysqld_safe
    then
      # Give extra arguments to mysqld with the my.cnf file. This script
      # may be overwritten at next upgrade.
      $bindir/mysqld_safe --defaults-file="$conf" --datadir="$datadir" --pid-file="$mysqld_pid_file_path" "$@" &
      wait_for_ready; return_value=$?
……

在这里插入图片描述
在这里插入图片描述

3.6 mariadb 初始化

[root@linux-001 mariadb]# ./scripts/mysql_install_db  --user=mysql --datadir=/data/mariadb
Installing MariaDB/MySQL system tables in '/data/mariadb' ...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system


PLEASE REMEMBER TO SET A PASSWORD FOR THE MariaDB root USER !
To do so, start the server, then issue the following commands:

'./bin/mysqladmin' -u root password 'new-password'
'./bin/mysqladmin' -u root -h linux-001 password 'new-password'

Alternatively you can run:
'./bin/mysql_secure_installation'

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the MariaDB Knowledgebase at http://mariadb.com/kb or the
MySQL manual for more instructions.

You can start the MariaDB daemon with:
cd '.' ; ./bin/mysqld_safe --datadir='/data/mariadb'

You can test the MariaDB daemon with mysql-test-run.pl
cd './mysql-test' ; perl mysql-test-run.pl

Please report any problems at http://mariadb.org/jira

The latest information about MariaDB is available at http://mariadb.org/.
You can find additional information about the MySQL part at:
http://dev.mysql.com
Consider joining MariaDB's strong and vibrant community:
https://mariadb.org/get-involved/

[root@linux-001 mariadb]# echo $?
0

3.7 启动mariadb服务

[root@linux-001 mariadb]# service mariadb start
Reloading systemd:                                         [  确定  ]
Starting mariadb (via systemctl):                          [  确定  ]
[root@linux-001 mariadb]# ps aux |grep mysql
root       8247  0.0  0.0 115436  1760 ?        S    06:53   0:00 /bin/sh /usr/local/mariadb/bin/mysqld_safe --defaults-file=/usr/local/mariadb/my.cnf --datadir=/data/mariadb --pid-file=/data/mariadb/linux-001.pid
mysql      8359  3.2  3.1 1124476 58668 ?       Sl   06:53   0:00 /usr/local/mariadb/bin/mysqld --defaults-file=/usr/local/mariadb/my.cnf --basedir=/usr/local/mariadb --datadir=/data/mariadb --plugin-dir=/usr/local/mariadb/lib/plugin --user=mysql --log-error=/data/mariadb/linux-001.err --pid-file=/data/mariadb/linux-001.pid --socket=/tmp/mysql.sock --port=3306
root       8401  0.0  0.0 112724   988 pts/0    R+   06:53   0:00 grep --color=auto mysql

3.8 安装mariadb中问题

没有在my.cnf配置文件中添加datadir的位置,会导致如下图中,数据存储位置是 /data/mysql/,而不是/data/mariadb。
在这里插入图片描述

4 apache 安装

4.1 下载httpd、apr、apr-util

[root@linux-01 ~]# cd /usr/local/src/
[root@linux-01 src]# ls
[root@linux-01 src]# 
[root@linux-01 src]# wget http://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
--2019-05-07 00:37:35--  http://archive.apache.org/dist/apr/apr-1.7.0.tar.gz
正在解析主机 archive.apache.org (archive.apache.org)... 163.172.17.199
正在连接 archive.apache.org (archive.apache.org)|163.172.17.199|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:1093896 (1.0M) [application/x-gzip]
正在保存至: “apr-1.7.0.tar.gz”

100%[========================================================================================================>] 1,093,896   21.9KB/s 用时 59s    

2019-05-07 00:38:35 (18.2 KB/s) - 已保存 “apr-1.7.0.tar.gz” [1093896/1093896])

[root@linux-01 src]# wget http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
--2019-05-07 00:38:41--  http://archive.apache.org/dist/apr/apr-util-1.6.1.tar.gz
正在解析主机 archive.apache.org (archive.apache.org)... 163.172.17.199
正在连接 archive.apache.org (archive.apache.org)|163.172.17.199|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:554301 (541K) [application/x-gzip]
正在保存至: “apr-util-1.6.1.tar.gz”

100%[========================================================================================================>] 554,301     28.3KB/s 用时 28s    

2019-05-07 00:39:09 (19.4 KB/s) - 已保存 “apr-util-1.6.1.tar.gz” [554301/554301])

[root@linux-01 src]# wget https://mirrors.cnnic.cn/apache/httpd/httpd-2.4.39.tar.gz
--2019-05-07 00:39:30--  https://mirrors.cnnic.cn/apache/httpd/httpd-2.4.39.tar.gz
正在解析主机 mirrors.cnnic.cn (mirrors.cnnic.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
正在连接 mirrors.cnnic.cn (mirrors.cnnic.cn)|101.6.8.193|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:9199150 (8.8M) [application/x-gzip]
正在保存至: “httpd-2.4.39.tar.gz”

100%[========================================================================================================>] 9,199,150   1.05MB/s 用时 11s    

2019-05-07 00:39:41 (834 KB/s) - 已保存 “httpd-2.4.39.tar.gz” [9199150/9199150])

4.2 解压文件

[root@linux-01 src]# tar -zxvf httpd-2.4.39.tar.gz
……
httpd-2.4.39/docs/manual/ssl/ssl_intro.html.fr.utf8
httpd-2.4.39/docs/manual/ssl/ssl_intro.html.en
httpd-2.4.39/docs/manual/ssl/ssl_compat.html.fr.utf8
httpd-2.4.39/docs/manual/glossary.html.fr.utf8
httpd-2.4.39/docs/manual/caching.html
httpd-2.4.39/docs/manual/custom-error.html.ja.utf8
httpd-2.4.39/docs/manual/new_features_2_2.html.tr.utf8
httpd-2.4.39/docs/manual/stopping.html.es
httpd-2.4.39/docs/manual/new_features_2_0.html.fr.utf8
httpd-2.4.39/docs/manual/new_features_2_0.html
httpd-2.4.39/docs/manual/urlmapping.html
httpd-2.4.39/buildconf
httpd-2.4.39/Makefile.in
httpd-2.4.39/srclib/
httpd-2.4.39/srclib/Makefile.in

[root@linux-01 src]# tar -zxvf apr-1.7.0.tar.gz
……
apr-1.7.0/build/aprapp.dep
apr-1.7.0/build/libtool.m4
apr-1.7.0/build/preaprapp.dsp
apr-1.7.0/build/get-version.sh
apr-1.7.0/build/cvtdsp.pl
apr-1.7.0/build/buildcheck.sh
apr-1.7.0/build/libaprapp.dep
apr-1.7.0/build/ltmain.sh
apr-1.7.0/build/PrintPath
apr-1.7.0/build/libaprapp.dsp
apr-1.7.0/apr.dsw
apr-1.7.0/libapr.dep

[root@linux-01 src]# tar -zxvf apr-util-1.6.1.tar.gz
……
apr-util-1.6.1/dbm/NWGNUmakefile
apr-util-1.6.1/dbm/apr_dbm_db.mak
apr-util-1.6.1/dbm/NWGNUdbmgdbm
apr-util-1.6.1/dbm/apr_dbm.c
apr-util-1.6.1/dbm/apr_dbm_sdbm.c
apr-util-1.6.1/dbm/apr_dbm_db.dsp
apr-util-1.6.1/dbm/apr_dbm_db.dep
apr-util-1.6.1/dbm/apr_dbm_berkeleydb.c
apr-util-1.6.1/dbm/apr_dbm_gdbm.dsp
apr-util-1.6.1/dbm/NWGNUdbmdb
apr-util-1.6.1/dbm/apr_dbm_gdbm.mak

4.3 安装apr

[root@linux-01 apr-1.7.0]# ls
apr-config.in  apr.pc.in  build.conf        configure     encoding    libapr.dsp  Makefile.in   network_io     random        support     tools
apr.dep        apr.spec   build-outputs.mk  configure.in  file_io     libapr.mak  Makefile.win  NOTICE         README        tables      user
apr.dsp        atomic     CHANGES           docs          helpers     libapr.rc   memory        NWGNUmakefile  README.cmake  test
apr.dsw        build      CMakeLists.txt    dso           include     LICENSE     misc          passwd         shmem         threadproc
apr.mak        buildconf  config.layout     emacs-mode    libapr.dep  locks       mmap          poll           strings       time

[root@linux-01 apr-1.7.0]# ./configure  --prefix=/usr/local/apr
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
Configuring APR library
Platform: x86_64-pc-linux-gnu
checking for working mkdir -p... yes
APR Version: 1.7.0
checking for chosen layout... apr
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/src/apr-1.7.0':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

安装apr的时候会提示如上的错误,说明缺少gcc,可以使用yum install -y gcc来安装gcc。

[root@linux-01 apr-1.7.0]# yum install -y gcc
已加载插件:fastestmirror, langpacks
Determining fastest mirrors
 * base: mirrors.aliyun.com
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
base                                                                                                                       | 3.6 kB  00:00:00     
extras                                                                                                                     | 3.4 kB  00:00:00     
updates                                                                                                                    | 3.4 kB  00:00:00     
(1/2): extras/7/x86_64/primary_db                                                                                          | 201 kB  00:00:01     
(2/2): updates/7/x86_64/primary_db                                                                                         | 4.2 MB  00:00:05     
正在解决依赖关系
--> 正在检查事务
---> 软件包 gcc.x86_64.0.4.8.5-36.el7_6.2 将被 安装
--> 正在处理依赖关系 libgomp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 cpp = 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 libgcc >= 4.8.5-36.el7_6.2,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在处理依赖关系 glibc-devel >= 2.2.90-12,它被软件包 gcc-4.8.5-36.el7_6.2.x86_64 需要
--> 正在检查事务
---> 软件包 cpp.x86_64.0.4.8.5-36.el7_6.2 将被 安装
---> 软件包 glibc-devel.x86_64.0.2.17-260.el7_6.4 将被 安装
--> 正在处理依赖关系 glibc-headers = 2.17-260.el7_6.4,它被软件包 glibc-devel-2.17-260.el7_6.4.x86_64 需要
--> 正在处理依赖关系 glibc = 2.17-260.el7_6.4,它被软件包 glibc-devel-2.17-260.el7_6.4.x86_64 需要
--> 正在处理依赖关系 glibc-headers,它被软件包 glibc-devel-2.17-260.el7_6.4.x86_64 需要
---> 软件包 libgcc.x86_64.0.4.8.5-36.el7 将被 升级
---> 软件包 libgcc.x86_64.0.4.8.5-36.el7_6.2 将被 更新
---> 软件包 libgomp.x86_64.0.4.8.5-36.el7 将被 升级
---> 软件包 libgomp.x86_64.0.4.8.5-36.el7_6.2 将被 更新
--> 正在检查事务
---> 软件包 glibc.x86_64.0.2.17-260.el7 将被 升级
--> 正在处理依赖关系 glibc = 2.17-260.el7,它被软件包 glibc-common-2.17-260.el7.x86_64 需要
---> 软件包 glibc.x86_64.0.2.17-260.el7_6.4 将被 更新
---> 软件包 glibc-headers.x86_64.0.2.17-260.el7_6.4 将被 安装
--> 正在处理依赖关系 kernel-headers >= 2.2.1,它被软件包 glibc-headers-2.17-260.el7_6.4.x86_64 需要
--> 正在处理依赖关系 kernel-headers,它被软件包 glibc-headers-2.17-260.el7_6.4.x86_64 需要
--> 正在检查事务
---> 软件包 glibc-common.x86_64.0.2.17-260.el7 将被 升级
---> 软件包 glibc-common.x86_64.0.2.17-260.el7_6.4 将被 更新
---> 软件包 kernel-headers.x86_64.0.3.10.0-957.12.1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==================================================================================================================================================
 Package                              架构                         版本                                       源                             大小
==================================================================================================================================================
正在安装:
 gcc                                  x86_64                       4.8.5-36.el7_6.2                           updates                        16 M
为依赖而安装:
 cpp                                  x86_64                       4.8.5-36.el7_6.2                           updates                       5.9 M
 glibc-devel                          x86_64                       2.17-260.el7_6.4                           updates                       1.1 M
 glibc-headers                        x86_64                       2.17-260.el7_6.4                           updates                       683 k
 kernel-headers                       x86_64                       3.10.0-957.12.1.el7                        updates                       8.0 M
为依赖而更新:
 glibc                                x86_64                       2.17-260.el7_6.4                           updates                       3.7 M
 glibc-common                         x86_64                       2.17-260.el7_6.4                           updates                        12 M
 libgcc                               x86_64                       4.8.5-36.el7_6.2                           updates                       102 k
 libgomp                              x86_64                       4.8.5-36.el7_6.2                           updates                       158 k

事务概要
==================================================================================================================================================
安装  1 软件包 (+4 依赖软件包)
升级           ( 4 依赖软件包)

总下载量:47 M
Downloading packages:
updates/7/x86_64/prestodelta                                                                                               | 623 kB  00:00:02     
Delta RPMs reduced 3.9 M of updates to 823 k (79% saved)
(1/9): libgcc-4.8.5-36.el7_4.8.5-36.el7_6.2.x86_64.drpm                                                                    |  44 kB  00:00:00     
(2/9): libgomp-4.8.5-36.el7_4.8.5-36.el7_6.2.x86_64.drpm                                                                   |  45 kB  00:00:00     
(3/9): glibc-2.17-260.el7_2.17-260.el7_6.4.x86_64.drpm                                                                     | 734 kB  00:00:01     
(4/9): glibc-headers-2.17-260.el7_6.4.x86_64.rpm                                                                           | 683 kB  00:00:01     
(5/9): glibc-devel-2.17-260.el7_6.4.x86_64.rpm                                                                             | 1.1 MB  00:00:13     
(6/9): cpp-4.8.5-36.el7_6.2.x86_64.rpm                                                                                     | 5.9 MB  00:00:17     
(7/9): kernel-headers-3.10.0-957.12.1.el7.x86_64.rpm                                                                       | 8.0 MB  00:00:23     
(8/9): gcc-4.8.5-36.el7_6.2.x86_64.rpm                                                                                     |  16 MB  00:00:39     
(9/9): glibc-common-2.17-260.el7_6.4.x86_64.rpm                                                                            |  12 MB  00:00:39     
--------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                              1.1 MB/s |  44 MB  00:00:40     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : libgcc-4.8.5-36.el7_6.2.x86_64                                                                                               1/13 
  正在更新    : glibc-common-2.17-260.el7_6.4.x86_64                                                                                         2/13 
  正在更新    : glibc-2.17-260.el7_6.4.x86_64                                                                                                3/13 
  正在更新    : libgomp-4.8.5-36.el7_6.2.x86_64                                                                                              4/13 
  正在安装    : cpp-4.8.5-36.el7_6.2.x86_64                                                                                                  5/13 
  正在安装    : kernel-headers-3.10.0-957.12.1.el7.x86_64                                                                                    6/13 
  正在安装    : glibc-headers-2.17-260.el7_6.4.x86_64                                                                                        7/13 
  正在安装    : glibc-devel-2.17-260.el7_6.4.x86_64                                                                                          8/13 
  正在安装    : gcc-4.8.5-36.el7_6.2.x86_64                                                                                                  9/13 
  清理        : libgomp-4.8.5-36.el7.x86_64                                                                                                 10/13 
  清理        : glibc-common-2.17-260.el7.x86_64                                                                                            11/13 
  清理        : glibc-2.17-260.el7.x86_64                                                                                                   12/13 
  清理        : libgcc-4.8.5-36.el7.x86_64                                                                                                  13/13 
  验证中      : glibc-2.17-260.el7_6.4.x86_64                                                                                                1/13 
  验证中      : glibc-devel-2.17-260.el7_6.4.x86_64                                                                                          2/13 
  验证中      : glibc-headers-2.17-260.el7_6.4.x86_64                                                                                        3/13 
  验证中      : glibc-common-2.17-260.el7_6.4.x86_64                                                                                         4/13 
  验证中      : libgcc-4.8.5-36.el7_6.2.x86_64                                                                                               5/13 
  验证中      : libgomp-4.8.5-36.el7_6.2.x86_64                                                                                              6/13 
  验证中      : cpp-4.8.5-36.el7_6.2.x86_64                                                                                                  7/13 
  验证中      : gcc-4.8.5-36.el7_6.2.x86_64                                                                                                  8/13 
  验证中      : kernel-headers-3.10.0-957.12.1.el7.x86_64                                                                                    9/13 
  验证中      : glibc-2.17-260.el7.x86_64                                                                                                   10/13 
  验证中      : libgomp-4.8.5-36.el7.x86_64                                                                                                 11/13 
  验证中      : glibc-common-2.17-260.el7.x86_64                                                                                            12/13 
  验证中      : libgcc-4.8.5-36.el7.x86_64                                                                                                  13/13 

已安装:
  gcc.x86_64 0:4.8.5-36.el7_6.2                                                                                                                   

作为依赖被安装:
  cpp.x86_64 0:4.8.5-36.el7_6.2                      glibc-devel.x86_64 0:2.17-260.el7_6.4        glibc-headers.x86_64 0:2.17-260.el7_6.4       
  kernel-headers.x86_64 0:3.10.0-957.12.1.el7       

作为依赖被升级:
  glibc.x86_64 0:2.17-260.el7_6.4  glibc-common.x86_64 0:2.17-260.el7_6.4  libgcc.x86_64 0:4.8.5-36.el7_6.2  libgomp.x86_64 0:4.8.5-36.el7_6.2 

完毕!

gcc安装好之后,需要对apr进行重新编译安装。

[root@linux-01 apr-1.7.0]# ./configure  --prefix=/usr/local/apr
……
configure: creating ./config.status
config.status: creating Makefile
config.status: creating include/apr.h
config.status: creating build/apr_rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating apr-1-config
config.status: creating apr.pc
config.status: creating test/Makefile
config.status: creating test/internal/Makefile
config.status: creating include/arch/unix/apr_private.h
config.status: executing libtool commands
rm: cannot remove 'libtoolT': No such file or directory
config.status: executing default commands
[root@linux-01 apr-1.7.0]# echo $?
0

[root@linux-01 apr-1.7.0]# make && make install
……
----------------------------------------------------------------------
/usr/bin/install -c -m 644 apr.exp /usr/local/apr/lib/apr.exp
/usr/bin/install -c -m 644 apr.pc /usr/local/apr/lib/pkgconfig/apr-1.pc
for f in libtool shlibtool; do \
    if test -f ${f}; then /usr/bin/install -c -m 755 ${f} /usr/local/apr/build-1; fi; \
done
/usr/bin/install -c -m 755 /usr/local/src/apr-1.7.0/build/mkdir.sh /usr/local/apr/build-1
for f in make_exports.awk make_var_export.awk; do \
    /usr/bin/install -c -m 644 /usr/local/src/apr-1.7.0/build/${f} /usr/local/apr/build-1; \
done
/usr/bin/install -c -m 644 build/apr_rules.out /usr/local/apr/build-1/apr_rules.mk
/usr/bin/install -c -m 755 apr-config.out /usr/local/apr/bin/apr-1-config
[root@linux-01 apr-1.7.0]# echo $?
0

[root@linux-01 apr-util-1.6.1]# ls /usr/local/apr/
bin  build-1  include  lib

4.4 安装apr-util

4.4.1 编译安装apr-util

[root@linux-01 apr-1.7.0]# cd ../apr-util-1.6.1/
[root@linux-01 apr-util-1.6.1]# ls
aprutil.dep     apu-config.in     CHANGES         dbd                include         LICENSE       NWGNUmakefile    strmatch
aprutil.dsp     buckets           CMakeLists.txt  dbm                ldap            Makefile.in   README           test
aprutil.dsw     build             config.layout   docs               libaprutil.dep  Makefile.win  README.cmake     uri
aprutil.mak     buildconf         configure       encoding           libaprutil.dsp  memcache      README.FREETDS   xlate
apr-util.pc.in  build.conf        configure.in    export_vars.sh.in  libaprutil.mak  misc          redis            xml
apr-util.spec   build-outputs.mk  crypto          hooks              libaprutil.rc   NOTICE        renames_pending
[root@linux-01 apr-util-1.6.1]# ./configure  --with-apr=/usr/local/apr --prefix=/usr/local/apr-util
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... yes
  setting CPP to "gcc -E"
  adding "-pthread" to CFLAGS
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... no
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking for odbc_config... no
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking odbc/sql.h usability... no
checking odbc/sql.h presence... no
checking for odbc/sql.h... no
checking Expat 1.95.x... no
checking old Debian-packaged expat... no
checking old FreeBSD-packaged expat... no
checking Expat 1.0/1.1... no
  setting LDFLAGS to "-L/usr/local/lib"
  adding "-I/usr/local/include" to CPPFLAGS
checking Expat 1.95.x in /usr/local... no
  nulling LDFLAGS
  removed "-I/usr/local/include" from CPPFLAGS
  setting APRUTIL_EXPORT_LIBS to ""
  setting APRUTIL_LIBS to ""
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
checking whether the compiler handles weak symbols... yes
checking for memset_s support... no
checking for explicit_bzero support... no
  setting APRUTIL_LIBS to " /usr/local/apr/lib/libapr-1.la -lrt -lcrypt  -lpthread -ldl"
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: include/private/apu_config.h is unchanged
config.status: executing default commands
[root@linux-01 apr-util-1.6.1]# echo $?
0
[root@linux-01 apr-util-1.6.1]# make && make install
make[1]: 进入目录“/usr/local/src/apr-util-1.6.1”
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_brigade.lo -c buckets/apr_brigade.c && touch buckets/apr_brigade.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets.lo -c buckets/apr_buckets.c && touch buckets/apr_buckets.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_alloc.lo -c buckets/apr_buckets_alloc.c && touch buckets/apr_buckets_alloc.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_eos.lo -c buckets/apr_buckets_eos.c && touch buckets/apr_buckets_eos.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_file.lo -c buckets/apr_buckets_file.c && touch buckets/apr_buckets_file.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_flush.lo -c buckets/apr_buckets_flush.c && touch buckets/apr_buckets_flush.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_heap.lo -c buckets/apr_buckets_heap.c && touch buckets/apr_buckets_heap.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_mmap.lo -c buckets/apr_buckets_mmap.c && touch buckets/apr_buckets_mmap.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_pipe.lo -c buckets/apr_buckets_pipe.c && touch buckets/apr_buckets_pipe.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_pool.lo -c buckets/apr_buckets_pool.c && touch buckets/apr_buckets_pool.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_refcount.lo -c buckets/apr_buckets_refcount.c && touch buckets/apr_buckets_refcount.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_simple.lo -c buckets/apr_buckets_simple.c && touch buckets/apr_buckets_simple.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_socket.lo -c buckets/apr_buckets_socket.c && touch buckets/apr_buckets_socket.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_crypto.lo -c crypto/apr_crypto.c && touch crypto/apr_crypto.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_md4.lo -c crypto/apr_md4.c && touch crypto/apr_md4.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_md5.lo -c crypto/apr_md5.c && touch crypto/apr_md5.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_passwd.lo -c crypto/apr_passwd.c && touch crypto/apr_passwd.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_sha1.lo -c crypto/apr_sha1.c && touch crypto/apr_sha1.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_siphash.lo -c crypto/apr_siphash.c && touch crypto/apr_siphash.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/crypt_blowfish.lo -c crypto/crypt_blowfish.c && touch crypto/crypt_blowfish.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/getuuid.lo -c crypto/getuuid.c && touch crypto/getuuid.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/uuid.lo -c crypto/uuid.c && touch crypto/uuid.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbd/apr_dbd.lo -c dbd/apr_dbd.c && touch dbd/apr_dbd.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/apr_dbm.lo -c dbm/apr_dbm.c && touch dbm/apr_dbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/apr_dbm_sdbm.lo -c dbm/apr_dbm_sdbm.c && touch dbm/apr_dbm_sdbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm.lo -c dbm/sdbm/sdbm.c && touch dbm/sdbm/sdbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_hash.lo -c dbm/sdbm/sdbm_hash.c && touch dbm/sdbm/sdbm_hash.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_lock.lo -c dbm/sdbm/sdbm_lock.c && touch dbm/sdbm/sdbm_lock.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_pair.lo -c dbm/sdbm/sdbm_pair.c && touch dbm/sdbm/sdbm_pair.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o encoding/apr_base64.lo -c encoding/apr_base64.c && touch encoding/apr_base64.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o hooks/apr_hooks.lo -c hooks/apr_hooks.c && touch hooks/apr_hooks.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o ldap/apr_ldap_stub.lo -c ldap/apr_ldap_stub.c && touch ldap/apr_ldap_stub.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o ldap/apr_ldap_url.lo -c ldap/apr_ldap_url.c && touch ldap/apr_ldap_url.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o memcache/apr_memcache.lo -c memcache/apr_memcache.c && touch memcache/apr_memcache.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_date.lo -c misc/apr_date.c && touch misc/apr_date.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_queue.lo -c misc/apr_queue.c && touch misc/apr_queue.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_reslist.lo -c misc/apr_reslist.c && touch misc/apr_reslist.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_rmm.lo -c misc/apr_rmm.c && touch misc/apr_rmm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_thread_pool.lo -c misc/apr_thread_pool.c && touch misc/apr_thread_pool.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apu_dso.lo -c misc/apu_dso.c && touch misc/apu_dso.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apu_version.lo -c misc/apu_version.c && touch misc/apu_version.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o redis/apr_redis.lo -c redis/apr_redis.c && touch redis/apr_redis.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o strmatch/apr_strmatch.lo -c strmatch/apr_strmatch.c && touch strmatch/apr_strmatch.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o uri/apr_uri.lo -c uri/apr_uri.c && touch uri/apr_uri.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xlate/xlate.lo -c xlate/xlate.c && touch xlate/xlate.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录
 #include <expat.h>
                   ^
编译中断。
make[1]: *** [xml/apr_xml.lo] 错误 1
make[1]: 离开目录“/usr/local/src/apr-util-1.6.1”
make: *** [all-recursive] 错误 1

4.4.2 make && make install 安装报错

缺少依赖expat,导致报错,安装expat的包。

[root@linux-01 apr-util-1.6.1]# yum install -y  expat-devel
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 expat-devel.x86_64.0.2.1.0-10.el7_3 将被 安装
--> 解决依赖关系完成

依赖关系解决

==================================================================================================================================================
 Package                              架构                            版本                                    源                             大小
==================================================================================================================================================
正在安装:
 expat-devel                          x86_64                          2.1.0-10.el7_3                          base                           57 k

事务概要
==================================================================================================================================================
安装  1 软件包

总下载量:57 k
安装大小:178 k
Downloading packages:
expat-devel-2.1.0-10.el7_3.x86_64.rpm                                                                                      |  57 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : expat-devel-2.1.0-10.el7_3.x86_64                                                                                             1/1 
  验证中      : expat-devel-2.1.0-10.el7_3.x86_64                                                                                             1/1 

已安装:
  expat-devel.x86_64 0:2.1.0-10.el7_3                                                                                                             

完毕!
[root@linux-01 apr-util-1.6.1]# 

4.4.3 重新编译apr-util,安装完成

[root@linux-01 apr-1.7.0]# cd ../apr-util-1.6.1/
[root@linux-01 apr-util-1.6.1]# 
[root@linux-01 apr-util-1.6.1]# ./configure  --with-apr=/usr/local/apr --prefix=/usr/local/apr-util
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking for working mkdir -p... yes
APR-util Version: 1.6.1
checking for chosen layout... apr-util
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
Applying apr-util hints file rules for x86_64-pc-linux-gnu
checking for APR... yes
  setting CPP to "gcc -E"
  adding "-pthread" to CFLAGS
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for ldap support...
checking for default DBM... sdbm (default)
checking for pg_config... no
checking libpq-fe.h usability... no
checking libpq-fe.h presence... no
checking for libpq-fe.h... no
checking postgresql/libpq-fe.h usability... no
checking postgresql/libpq-fe.h presence... no
checking for postgresql/libpq-fe.h... no
checking sqlite3.h usability... no
checking sqlite3.h presence... no
checking for sqlite3.h... no
checking sqlite.h usability... no
checking sqlite.h presence... no
checking for sqlite.h... no
checking for odbc_config... no
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking odbc/sql.h usability... no
checking odbc/sql.h presence... no
checking for odbc/sql.h... no
checking Expat 1.95.x... yes
  setting APRUTIL_EXPORT_LIBS to "-lexpat"
  setting APRUTIL_LIBS to "-lexpat"
checking iconv.h usability... yes
checking iconv.h presence... yes
checking for iconv.h... yes
checking for type of inbuf parameter to iconv... char **
checking for iconv.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking for nl_langinfo... yes
checking for CODESET in langinfo.h... yes
checking whether APR has DSO support... yes
checking for library containing crypt... -lcrypt
checking if system crypt() function is threadsafe... no
checking for crypt_r... yes
checking style of crypt_r... struct_crypt_data
checking whether the compiler handles weak symbols... yes
checking for memset_s support... no
checking for explicit_bzero support... no
  adding "/usr/local/apr/lib/libapr-1.la" to APRUTIL_LIBS
  adding "-lrt" to APRUTIL_LIBS
  adding "-lcrypt" to APRUTIL_LIBS
  adding "-lpthread" to APRUTIL_LIBS
  adding "-ldl" to APRUTIL_LIBS
configure: creating ./config.status
config.status: creating Makefile
config.status: creating export_vars.sh
config.status: creating build/pkg/pkginfo
config.status: creating apr-util.pc
config.status: creating apu-1-config
config.status: creating include/private/apu_select_dbm.h
config.status: creating include/apr_ldap.h
config.status: creating include/apu.h
config.status: creating include/apu_want.h
config.status: creating test/Makefile
config.status: creating include/private/apu_config.h
config.status: executing default commands
[root@linux-01 apr-util-1.6.1]# echo $?
0
[root@linux-01 apr-util-1.6.1]# 

[root@linux-01 apr-util-1.6.1]# make && make install
make[1]: 进入目录“/usr/local/src/apr-util-1.6.1”
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_brigade.lo -c buckets/apr_brigade.c && touch buckets/apr_brigade.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets.lo -c buckets/apr_buckets.c && touch buckets/apr_buckets.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_alloc.lo -c buckets/apr_buckets_alloc.c && touch buckets/apr_buckets_alloc.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_eos.lo -c buckets/apr_buckets_eos.c && touch buckets/apr_buckets_eos.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_file.lo -c buckets/apr_buckets_file.c && touch buckets/apr_buckets_file.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_flush.lo -c buckets/apr_buckets_flush.c && touch buckets/apr_buckets_flush.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_heap.lo -c buckets/apr_buckets_heap.c && touch buckets/apr_buckets_heap.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_mmap.lo -c buckets/apr_buckets_mmap.c && touch buckets/apr_buckets_mmap.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_pipe.lo -c buckets/apr_buckets_pipe.c && touch buckets/apr_buckets_pipe.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_pool.lo -c buckets/apr_buckets_pool.c && touch buckets/apr_buckets_pool.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_refcount.lo -c buckets/apr_buckets_refcount.c && touch buckets/apr_buckets_refcount.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_simple.lo -c buckets/apr_buckets_simple.c && touch buckets/apr_buckets_simple.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o buckets/apr_buckets_socket.lo -c buckets/apr_buckets_socket.c && touch buckets/apr_buckets_socket.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_crypto.lo -c crypto/apr_crypto.c && touch crypto/apr_crypto.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_md4.lo -c crypto/apr_md4.c && touch crypto/apr_md4.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_md5.lo -c crypto/apr_md5.c && touch crypto/apr_md5.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_passwd.lo -c crypto/apr_passwd.c && touch crypto/apr_passwd.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_sha1.lo -c crypto/apr_sha1.c && touch crypto/apr_sha1.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/apr_siphash.lo -c crypto/apr_siphash.c && touch crypto/apr_siphash.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/crypt_blowfish.lo -c crypto/crypt_blowfish.c && touch crypto/crypt_blowfish.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/getuuid.lo -c crypto/getuuid.c && touch crypto/getuuid.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o crypto/uuid.lo -c crypto/uuid.c && touch crypto/uuid.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbd/apr_dbd.lo -c dbd/apr_dbd.c && touch dbd/apr_dbd.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/apr_dbm.lo -c dbm/apr_dbm.c && touch dbm/apr_dbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/apr_dbm_sdbm.lo -c dbm/apr_dbm_sdbm.c && touch dbm/apr_dbm_sdbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm.lo -c dbm/sdbm/sdbm.c && touch dbm/sdbm/sdbm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_hash.lo -c dbm/sdbm/sdbm_hash.c && touch dbm/sdbm/sdbm_hash.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_lock.lo -c dbm/sdbm/sdbm_lock.c && touch dbm/sdbm/sdbm_lock.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o dbm/sdbm/sdbm_pair.lo -c dbm/sdbm/sdbm_pair.c && touch dbm/sdbm/sdbm_pair.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o encoding/apr_base64.lo -c encoding/apr_base64.c && touch encoding/apr_base64.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o hooks/apr_hooks.lo -c hooks/apr_hooks.c && touch hooks/apr_hooks.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o ldap/apr_ldap_stub.lo -c ldap/apr_ldap_stub.c && touch ldap/apr_ldap_stub.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o ldap/apr_ldap_url.lo -c ldap/apr_ldap_url.c && touch ldap/apr_ldap_url.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o memcache/apr_memcache.lo -c memcache/apr_memcache.c && touch memcache/apr_memcache.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_date.lo -c misc/apr_date.c && touch misc/apr_date.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_queue.lo -c misc/apr_queue.c && touch misc/apr_queue.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_reslist.lo -c misc/apr_reslist.c && touch misc/apr_reslist.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_rmm.lo -c misc/apr_rmm.c && touch misc/apr_rmm.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apr_thread_pool.lo -c misc/apr_thread_pool.c && touch misc/apr_thread_pool.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apu_dso.lo -c misc/apu_dso.c && touch misc/apu_dso.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o misc/apu_version.lo -c misc/apu_version.c && touch misc/apu_version.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o redis/apr_redis.lo -c redis/apr_redis.c && touch redis/apr_redis.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o strmatch/apr_strmatch.lo -c strmatch/apr_strmatch.c && touch strmatch/apr_strmatch.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o uri/apr_uri.lo -c uri/apr_uri.c && touch uri/apr_uri.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xlate/xlate.lo -c xlate/xlate.c && touch xlate/xlate.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=compile gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread   -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1     -version-info 6:1:6    -o libaprutil-1.la -rpath /usr/local/apr-util/lib buckets/apr_brigade.lo buckets/apr_buckets.lo buckets/apr_buckets_alloc.lo buckets/apr_buckets_eos.lo buckets/apr_buckets_file.lo buckets/apr_buckets_flush.lo buckets/apr_buckets_heap.lo buckets/apr_buckets_mmap.lo buckets/apr_buckets_pipe.lo buckets/apr_buckets_pool.lo buckets/apr_buckets_refcount.lo buckets/apr_buckets_simple.lo buckets/apr_buckets_socket.lo crypto/apr_crypto.lo crypto/apr_md4.lo crypto/apr_md5.lo crypto/apr_passwd.lo crypto/apr_sha1.lo crypto/apr_siphash.lo crypto/crypt_blowfish.lo crypto/getuuid.lo crypto/uuid.lo dbd/apr_dbd.lo dbm/apr_dbm.lo dbm/apr_dbm_sdbm.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo dbm/sdbm/sdbm_lock.lo dbm/sdbm/sdbm_pair.lo encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo memcache/apr_memcache.lo misc/apr_date.lo misc/apr_queue.lo misc/apr_reslist.lo misc/apr_rmm.lo misc/apr_thread_pool.lo misc/apu_dso.lo misc/apu_version.lo redis/apr_redis.lo strmatch/apr_strmatch.lo uri/apr_uri.lo xlate/xlate.lo xml/apr_xml.lo    -lrt -lcrypt  -lpthread -ldl  -lexpat /usr/local/apr/lib/libapr-1.la -lrt -lcrypt -lpthread -ldl
gawk -f /usr/local/apr/build-1/make_exports.awk /usr/local/src/apr-util-1.6.1/include/apr_anylock.h /usr/local/src/apr-util-1.6.1/include/apr_base64.h /usr/local/src/apr-util-1.6.1/include/apr_buckets.h /usr/local/src/apr-util-1.6.1/include/apr_crypto.h /usr/local/src/apr-util-1.6.1/include/apr_date.h /usr/local/src/apr-util-1.6.1/include/apr_dbd.h /usr/local/src/apr-util-1.6.1/include/apr_dbm.h /usr/local/src/apr-util-1.6.1/include/apr_hooks.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_init.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_option.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_rebind.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_url.h /usr/local/src/apr-util-1.6.1/include/apr_md4.h /usr/local/src/apr-util-1.6.1/include/apr_md5.h /usr/local/src/apr-util-1.6.1/include/apr_memcache.h /usr/local/src/apr-util-1.6.1/include/apr_optional.h /usr/local/src/apr-util-1.6.1/include/apr_optional_hooks.h /usr/local/src/apr-util-1.6.1/include/apr_queue.h /usr/local/src/apr-util-1.6.1/include/apr_redis.h /usr/local/src/apr-util-1.6.1/include/apr_reslist.h /usr/local/src/apr-util-1.6.1/include/apr_rmm.h /usr/local/src/apr-util-1.6.1/include/apr_sdbm.h /usr/local/src/apr-util-1.6.1/include/apr_sha1.h /usr/local/src/apr-util-1.6.1/include/apr_siphash.h /usr/local/src/apr-util-1.6.1/include/apr_strmatch.h /usr/local/src/apr-util-1.6.1/include/apr_thread_pool.h /usr/local/src/apr-util-1.6.1/include/apr_uri.h /usr/local/src/apr-util-1.6.1/include/apr_uuid.h /usr/local/src/apr-util-1.6.1/include/apr_xlate.h /usr/local/src/apr-util-1.6.1/include/apr_xml.h /usr/local/src/apr-util-1.6.1/include/apu_errno.h /usr/local/src/apr-util-1.6.1/include/apu_version.h /usr/local/src/apr-util-1.6.1/include/private/apr_crypto_internal.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbd_internal.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbd_odbc_v2.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbm_private.h /usr/local/src/apr-util-1.6.1/include/private/apu_internal.h > exports.c
gawk -f /usr/local/apr/build-1/make_var_export.awk /usr/local/src/apr-util-1.6.1/include/apr_anylock.h /usr/local/src/apr-util-1.6.1/include/apr_base64.h /usr/local/src/apr-util-1.6.1/include/apr_buckets.h /usr/local/src/apr-util-1.6.1/include/apr_crypto.h /usr/local/src/apr-util-1.6.1/include/apr_date.h /usr/local/src/apr-util-1.6.1/include/apr_dbd.h /usr/local/src/apr-util-1.6.1/include/apr_dbm.h /usr/local/src/apr-util-1.6.1/include/apr_hooks.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_init.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_option.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_rebind.h /usr/local/src/apr-util-1.6.1/include/apr_ldap_url.h /usr/local/src/apr-util-1.6.1/include/apr_md4.h /usr/local/src/apr-util-1.6.1/include/apr_md5.h /usr/local/src/apr-util-1.6.1/include/apr_memcache.h /usr/local/src/apr-util-1.6.1/include/apr_optional.h /usr/local/src/apr-util-1.6.1/include/apr_optional_hooks.h /usr/local/src/apr-util-1.6.1/include/apr_queue.h /usr/local/src/apr-util-1.6.1/include/apr_redis.h /usr/local/src/apr-util-1.6.1/include/apr_reslist.h /usr/local/src/apr-util-1.6.1/include/apr_rmm.h /usr/local/src/apr-util-1.6.1/include/apr_sdbm.h /usr/local/src/apr-util-1.6.1/include/apr_sha1.h /usr/local/src/apr-util-1.6.1/include/apr_siphash.h /usr/local/src/apr-util-1.6.1/include/apr_strmatch.h /usr/local/src/apr-util-1.6.1/include/apr_thread_pool.h /usr/local/src/apr-util-1.6.1/include/apr_uri.h /usr/local/src/apr-util-1.6.1/include/apr_uuid.h /usr/local/src/apr-util-1.6.1/include/apr_xlate.h /usr/local/src/apr-util-1.6.1/include/apr_xml.h /usr/local/src/apr-util-1.6.1/include/apu_errno.h /usr/local/src/apr-util-1.6.1/include/apu_version.h /usr/local/src/apr-util-1.6.1/include/private/apr_crypto_internal.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbd_internal.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbd_odbc_v2.h /usr/local/src/apr-util-1.6.1/include/private/apr_dbm_private.h /usr/local/src/apr-util-1.6.1/include/private/apu_internal.h > export_vars.c
gcc -E -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    exports.c | grep "ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> aprutil.exp
gcc -E -DHAVE_CONFIG_H  -DLINUX -D_REENTRANT -D_GNU_SOURCE   -I/usr/local/src/apr-util-1.6.1/include -I/usr/local/src/apr-util-1.6.1/include/private  -I/usr/local/apr/include/apr-1    export_vars.c | sed -e 's/^\#[^!]*//' | sed -e '/^$/d' >> aprutil.exp
sed 's,^\(location=\).*$,\1installed,' < apu-1-config > apu-config.out
make[1]: 离开目录“/usr/local/src/apr-util-1.6.1”
make[1]: 进入目录“/usr/local/src/apr-util-1.6.1”
make[1]: 对“local-all”无需做任何事。
make[1]: 离开目录“/usr/local/src/apr-util-1.6.1”
/usr/local/apr/build-1/mkdir.sh /usr/local/apr-util/include/apr-1 /usr/local/apr-util/lib/pkgconfig \
	     /usr/local/apr-util/lib /usr/local/apr-util/bin
for f in /usr/local/src/apr-util-1.6.1/include/*.h /usr/local/src/apr-util-1.6.1/include/*.h; do \
	/usr/bin/install -c -m 644 ${f} /usr/local/apr-util/include/apr-1; \
done
/usr/bin/install -c -m 644 apr-util.pc /usr/local/apr-util/lib/pkgconfig/apr-util-1.pc
list=''; for i in $list; do \
	( cd $i ; make DESTDIR= install ); \
done
/bin/sh /usr/local/apr/build-1/libtool --mode=install /usr/bin/install -c -m 755 libaprutil-1.la /usr/local/apr-util/lib
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.6.1 /usr/local/apr-util/lib/libaprutil-1.so.0.6.1
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so.0 || { rm -f libaprutil-1.so.0 && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so.0; }; })
libtool: install: (cd /usr/local/apr-util/lib && { ln -s -f libaprutil-1.so.0.6.1 libaprutil-1.so || { rm -f libaprutil-1.so && ln -s libaprutil-1.so.0.6.1 libaprutil-1.so; }; })
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.lai /usr/local/apr-util/lib/libaprutil-1.la
libtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.a /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: chmod 644 /usr/local/apr-util/lib/libaprutil-1.a
libtool: install: ranlib /usr/local/apr-util/lib/libaprutil-1.a
libtool: finish: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/sbin" ldconfig -n /usr/local/apr-util/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/apr-util/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the '-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the 'LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the 'LD_RUN_PATH' environment variable
     during linking
   - use the '-Wl,-rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to '/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
/usr/bin/install -c -m 644 aprutil.exp /usr/local/apr-util/lib
/usr/bin/install -c -m 755 apu-config.out /usr/local/apr-util/bin/apu-1-config
[root@linux-01 apr-util-1.6.1]# echo $?
0

[root@linux-01 apr-util-1.6.1]# ls /usr/local/apr-util/
bin  include  lib

4.5 安装httpd

4.5.1 编译安装httpd

[root@linux-01 apr-util-1.6.1]# cd ../httpd-2.4.39/
[root@linux-01 httpd-2.4.39]# ls
ABOUT_APACHE     ap.d          CHANGES         docs         httpd.spec      libhttpd.dep  Makefile.win   README            srclib
acinclude.m4     build         CMakeLists.txt  emacs-style  include         libhttpd.dsp  modules        README.cmake      support
Apache-apr2.dsw  BuildAll.dsp  config.layout   httpd.dep    INSTALL         libhttpd.mak  NOTICE         README.platforms  test
Apache.dsw       BuildBin.dsp  configure       httpd.dsp    InstallBin.dsp  LICENSE       NWGNUmakefile  ROADMAP           VERSIONING
apache_probes.d  buildconf     configure.in    httpd.mak    LAYOUT          Makefile.in   os             server

[root@linux-01 httpd-2.4.39]# ./configure --prefix=/usr/local/httpd2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... false
configure: error: pcre-config for libpcre not found. PCRE is required and available from http://pcre.org/
[root@linux-01 httpd-2.4.39]# 

4.5.2 编译安装报错,提示没有pcre

[root@linux-01 httpd-2.4.39]# yum install -y pcre-devel
已加载插件:fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.aliyun.com
 * extras: mirrors.163.com
 * updates: mirrors.aliyun.com
正在解决依赖关系
--> 正在检查事务
---> 软件包 pcre-devel.x86_64.0.8.32-17.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

==================================================================================================================================================
 Package                              架构                             版本                                  源                              大小
==================================================================================================================================================
正在安装:
 pcre-devel                           x86_64                           8.32-17.el7                           base                           480 k

事务概要
==================================================================================================================================================
安装  1 软件包

总下载量:480 k
安装大小:1.4 M
Downloading packages:
pcre-devel-8.32-17.el7.x86_64.rpm                                                                                          | 480 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : pcre-devel-8.32-17.el7.x86_64                                                                                                 1/1 
  验证中      : pcre-devel-8.32-17.el7.x86_64                                                                                                 1/1 

已安装:
  pcre-devel.x86_64 0:8.32-17.el7                                                                                                                 

完毕!
[root@linux-01 httpd-2.4.39]# 

4.5.3 重新编译安装httpd,安装完成


[root@linux-01 httpd-2.4.39]# ./configure --prefix=/usr/local/httpd2.4 --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --enable-so --enable-mods-shared=most
checking for chosen layout... Apache
checking for working mkdir -p... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
configure: 
configure: Configuring Apache Portable Runtime library...
configure: 
checking for APR... yes
  setting CC to "gcc"
  setting CPP to "gcc -E"
  setting CFLAGS to " -g -O2 -pthread"
  setting CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  setting LDFLAGS to " "
configure: 
configure: Configuring Apache Portable Runtime Utility library...
configure: 
checking for APR-util... yes
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for gcc option to accept ISO C99... -std=gnu99
checking for pcre-config... /usr/bin/pcre-config
configure: Using external PCRE library from /usr/bin/pcre-config
  setting PCRE_INCLUDES to ""
  setting PCRE_LIBS to "-lpcre"
configure: 
configure: Configuring Apache httpd...
configure: 
  setting INCLUDES to "-I."
  adding "-I$(top_srcdir)/os/$(OS_DIR)" to INCLUDES
  adding "-I$(top_srcdir)/include" to INCLUDES
  adding "-I/usr/local/apr/include/apr-1" to INCLUDES
  adding "-I/usr/local/apr-util/include/apr-1" to INCLUDES
configure: 
configure: Applying OS-specific hints for httpd...
configure: 
  forcing SINGLE_LISTEN_UNSERIALIZED_ACCEPT to "1"
  forcing AP_NONBLOCK_WHEN_MULTI_LISTEN to "1"
checking for rm... /usr/bin/rm
checking for pkg-config... /usr/bin/pkg-config
checking for rsync... /usr/bin/rsync
checking for gawk... gawk
checking whether ln -s works... yes
checking for ranlib... ranlib
checking for lynx... no
checking for links... no
checking for elinks... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for library containing strerror... none required
checking for APR version 1.3.0 or later... yes
checking for APR-util version 1.3.0 or later... yes
checking for ANSI C header files... (cached) yes
checking for string.h... (cached) yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for unistd.h... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking grp.h usability... yes
checking grp.h presence... yes
checking for grp.h... yes
checking for strings.h... (cached) yes
checking sys/prctl.h usability... yes
checking sys/prctl.h presence... yes
checking for sys/prctl.h... yes
checking sys/processor.h usability... no
checking sys/processor.h presence... no
checking for sys/processor.h... no
checking sys/sem.h usability... yes
checking sys/sem.h presence... yes
checking for sys/sem.h... yes
checking sys/sdt.h usability... no
checking sys/sdt.h presence... no
checking for sys/sdt.h... no
checking sys/loadavg.h usability... no
checking sys/loadavg.h presence... no
checking for sys/loadavg.h... no
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for an ANSI C-conforming const... yes
checking for library containing sqrt... -lm
checking for library containing crypt... -lcrypt
checking for getpwnam... yes
checking for getgrnam... yes
checking for initgroups... yes
checking for bindprocessor... no
checking for prctl... yes
checking for timegm... yes
checking for getpgid... yes
checking for fopen64... yes
checking for getloadavg... yes
checking for void pointer length... no
checking for gettid()... yes
checking for tm_gmtoff in struct tm... yes
checking whether to enable mod_authn_file... shared
checking whether to enable mod_authn_dbm... shared (most)
checking whether to enable mod_authn_anon... shared (most)
checking whether to enable mod_authn_dbd... shared (most)
checking whether to enable mod_authn_socache... shared (most)
checking whether to enable mod_authn_core... shared
checking whether to enable mod_authz_host... shared
checking whether to enable mod_authz_groupfile... shared
checking whether to enable mod_authz_user... shared
checking whether to enable mod_authz_dbm... shared (most)
checking whether to enable mod_authz_owner... shared (most)
checking whether to enable mod_authz_dbd... shared (most)
checking whether to enable mod_authz_core... shared
checking whether to enable mod_authnz_ldap... checking dependencies
checking for ldap support in apr/apr-util... no
configure: WARNING: apr/apr-util is compiled without ldap support
checking whether to enable mod_authnz_ldap... no (disabled)
checking whether to enable mod_authnz_fcgi... no
checking whether to enable mod_access_compat... shared
checking whether to enable mod_auth_basic... shared
checking whether to enable mod_auth_form... shared (most)
checking whether to enable mod_auth_digest... checking dependencies
checking whether to enable mod_auth_digest... shared (most)
checking whether to enable mod_allowmethods... shared (most)
  adding "-I$(top_srcdir)/modules/aaa" to INCLUDES
checking whether to enable mod_isapi... no
checking whether to enable mod_file_cache... shared (most)
checking whether to enable mod_cache... shared (most)
checking whether to enable mod_cache_disk... checking dependencies
checking whether to enable mod_cache_disk... shared (most)
checking whether to enable mod_cache_socache... shared (most)
checking whether to enable mod_socache_shmcb... shared (most)
checking whether to enable mod_socache_dbm... shared (most)
checking whether to enable mod_socache_memcache... shared (most)
checking whether to enable mod_socache_redis... shared (most)
checking whether to enable mod_socache_dc... no
  adding "-I$(top_srcdir)/modules/cache" to INCLUDES
  setting HTTPD_LDFLAGS to "-export-dynamic"
checking whether to enable mod_so... static
  setting AP_LIBS to "$(MOD_SO_LDADD)"
checking whether to enable mod_watchdog... checking dependencies
checking whether to enable mod_watchdog... shared (most)
checking whether to enable mod_macro... shared (most)
  adding "-I$(top_srcdir)/modules/core" to INCLUDES
checking whether to enable mod_dbd... shared (most)
  adding "-I$(top_srcdir)/modules/database" to INCLUDES
checking whether to enable mod_bucketeer... no
checking whether to enable mod_dumpio... shared (most)
checking whether to enable mod_echo... no
checking whether to enable mod_example_hooks... no
checking whether to enable mod_case_filter... no
checking whether to enable mod_case_filter_in... no
checking whether to enable mod_example_ipc... no
checking whether to enable mod_buffer... shared (most)
checking whether to enable mod_data... no
checking whether to enable mod_ratelimit... shared (most)
checking whether to enable mod_reqtimeout... shared
checking whether to enable mod_ext_filter... shared (most)
checking whether to enable mod_request... shared (most)
checking whether to enable mod_include... shared (most)
checking whether to enable mod_filter... shared
checking whether to enable mod_reflector... no
checking whether to enable mod_substitute... shared (most)
checking whether to enable mod_sed... checking dependencies
  setting MOD_SED_LDADD to "-export-symbols-regex sed_module"
checking whether to enable mod_sed... shared (most)
checking whether to enable mod_charset_lite... no
checking whether to enable mod_deflate... checking dependencies
checking for zlib location... not found
checking whether to enable mod_deflate... no (disabled)
checking whether to enable mod_xml2enc... no
checking whether to enable mod_proxy_html... no
checking whether to enable mod_brotli... checking dependencies
checking for Brotli library >= 0.6.0 via pkg-config... no
checking whether to enable mod_brotli... no (disabled)
  adding "-I$(top_srcdir)/modules/filters" to INCLUDES
checking whether to enable mod_http... static
  adding "$(MOD_HTTP_LDADD)" to AP_LIBS
checking whether to enable mod_mime... shared
checking whether to enable mod_ldap... checking dependencies
checking for ldap support in apr/apr-util... (cached) no
configure: WARNING: apr/apr-util is compiled without ldap support
checking whether to enable mod_ldap... no (disabled)
  adding "-I$(top_srcdir)/modules/ldap" to INCLUDES
checking whether to enable mod_log_config... shared
checking whether to enable mod_log_debug... shared (most)
checking whether to enable mod_log_forensic... no
checking whether to enable mod_logio... shared (most)
  adding "-I$(top_srcdir)/modules/loggers" to INCLUDES
checking whether to enable mod_lua... no
  adding "-I$(top_srcdir)/modules/lua" to INCLUDES
checking whether to enable mod_env... shared
checking whether to enable mod_mime_magic... no
checking whether to enable mod_cern_meta... no
checking whether to enable mod_expires... shared (most)
checking whether to enable mod_headers... shared
checking whether to enable mod_ident... no
checking whether to enable mod_usertrack... no
checking whether to enable mod_unique_id... shared (most)
checking whether to enable mod_setenvif... shared
checking whether to enable mod_version... shared
checking whether to enable mod_remoteip... shared (most)
checking whether to enable mod_proxy... shared (most)
checking whether to enable mod_proxy_connect... checking dependencies
checking whether to enable mod_proxy_connect... shared (most)
checking whether to enable mod_proxy_ftp... checking dependencies
checking whether to enable mod_proxy_ftp... shared (most)
checking whether to enable mod_proxy_http... checking dependencies
checking whether to enable mod_proxy_http... shared (most)
checking whether to enable mod_proxy_fcgi... checking dependencies
checking whether to enable mod_proxy_fcgi... shared (most)
checking whether to enable mod_proxy_scgi... checking dependencies
checking whether to enable mod_proxy_scgi... shared (most)
checking whether to enable mod_proxy_uwsgi... checking dependencies
checking whether to enable mod_proxy_uwsgi... shared (most)
checking whether to enable mod_proxy_fdpass... checking dependencies
checking whether CMSG_DATA is declared... yes
checking whether to enable mod_proxy_fdpass... shared (most)
checking whether to enable mod_proxy_wstunnel... checking dependencies
checking whether to enable mod_proxy_wstunnel... shared (most)
checking whether to enable mod_proxy_ajp... checking dependencies
checking whether to enable mod_proxy_ajp... shared (most)
checking whether to enable mod_proxy_balancer... checking dependencies
checking whether to enable mod_proxy_balancer... shared (most)
checking whether to enable mod_proxy_express... checking dependencies
checking whether to enable mod_proxy_express... shared (most)
checking whether to enable mod_proxy_hcheck... checking dependencies
checking whether to enable mod_proxy_hcheck... shared (most)
  adding "-I$(top_srcdir)/modules/proxy" to INCLUDES
  adding "-I$(top_srcdir)/modules/http2" to INCLUDES
checking whether to enable mod_session... shared (most)
checking whether to enable mod_session_cookie... checking dependencies
checking whether to enable mod_session_cookie... shared (most)
configure: WARNING: Your APR does not include SSL/EVP support. To enable it: configure --with-crypto
checking whether to enable mod_session_crypto... no
checking whether to enable mod_session_dbd... checking dependencies
checking whether to enable mod_session_dbd... shared (most)
  adding "-I$(top_srcdir)/modules/session" to INCLUDES
checking whether to enable mod_slotmem_shm... shared (most)
checking whether to enable mod_slotmem_plain... no
checking whether to enable mod_ssl... checking dependencies
checking for OpenSSL... checking for user-provided OpenSSL base directory... none
checking for OpenSSL version >= 0.9.8a... FAILED
configure: WARNING: OpenSSL version is too old
no
checking whether to enable mod_ssl... no (disabled)
  adding "-I$(top_srcdir)/modules/ssl" to INCLUDES
checking whether to enable mod_optional_hook_export... no
checking whether to enable mod_optional_hook_import... no
checking whether to enable mod_optional_fn_import... no
checking whether to enable mod_optional_fn_export... no
checking whether to enable mod_dialup... no
  adding "-I$(top_srcdir)/modules/test" to INCLUDES
checking for target platform... unix
checking for rlim_t... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking for sys/sem.h... (cached) yes
checking sys/ipc.h usability... yes
checking sys/ipc.h presence... yes
checking for sys/ipc.h... yes
checking for setsid... yes
checking for killpg... yes
checking bstring.h usability... no
checking bstring.h presence... no
checking for bstring.h... no
checking for unistd.h... (cached) yes
checking for syslog... yes
checking sys/times.h usability... yes
checking sys/times.h presence... yes
checking for sys/times.h... yes
checking for times... yes
  adding "-I$(top_srcdir)/server" to INCLUDES
checking whether APR supports thread-safe pollsets... checking for kqueue... no
checking for port_create... no
checking for epoll_create... yes
yes
checking if event MPM supports this platform... yes
checking if mpmt_os2 MPM supports this platform... no
checking if prefork MPM supports this platform... yes
checking if WinNT MPM supports this platform... no
checking if worker MPM supports this platform... yes
checking whether to enable mod_http2... checking dependencies
checking for OpenSSL... (cached) no
checking for nghttp2... checking for user-provided nghttp2 base directory... none
checking for pkg-config along ... checking for nghttp2 version >= 1.2.1... FAILED
configure: WARNING: nghttp2 version is too old
no
checking whether to enable mod_http2... no (disabled)
checking whether to enable mod_proxy_http2... no
  adding "-I$(top_srcdir)/modules/md" to INCLUDES
checking whether to enable mod_md... checking dependencies
checking for OpenSSL... (cached) no
configure: WARNING: libssl (or compatible) not found
checking for jansson... checking for user-provided jansson base directory... none
checking for pkg-config along ... FAILED
no
configure: WARNING: libjansson not found
checking for curl... checking for user-provided curl base directory... none
checking for pkg-config along ... checking curl/curl.h usability... no
checking curl/curl.h presence... no
checking for curl/curl.h... no
checking for curl version >= 7.50... FAILED
no
configure: WARNING: libcurl not found
checking for arc4random_buf... no
checking whether to enable mod_md... no (disabled)
checking whether to enable mod_lbmethod_byrequests... checking dependencies
checking whether to enable mod_lbmethod_byrequests... shared
checking whether to enable mod_lbmethod_bytraffic... checking dependencies
checking whether to enable mod_lbmethod_bytraffic... shared
checking whether to enable mod_lbmethod_bybusyness... checking dependencies
checking whether to enable mod_lbmethod_bybusyness... shared
checking whether to enable mod_lbmethod_heartbeat... checking dependencies
checking whether to enable mod_lbmethod_heartbeat... shared
checking which MPM to use by default... event
  adding "$(MOD_MPM_EVENT_LDADD)" to AP_LIBS
checking for pthread_kill... yes
checking whether to enable mod_unixd... shared
checking whether to enable mod_privileges... no
  adding "-I$(top_srcdir)/modules/arch/unix" to INCLUDES
checking whether to enable mod_heartbeat... no
checking whether to enable mod_heartmonitor... no
checking whether to enable mod_dav... shared (most)
  adding "-I$(top_srcdir)/modules/dav/main" to INCLUDES
checking whether to enable mod_status... shared
checking whether to enable mod_autoindex... shared
checking whether to enable mod_asis... no
checking whether to enable mod_info... shared (most)
checking whether to enable mod_suexec... no
checking whether to enable mod_cgid... checking dependencies
checking whether to enable mod_cgid... shared (most)
checking whether to enable mod_cgi... no
  adding "-I$(top_srcdir)/modules/generators" to INCLUDES
checking whether to enable mod_dav_fs... checking dependencies
checking whether to enable mod_dav_fs... shared
checking whether to enable mod_dav_lock... no
checking for extra modules... none
checking whether to enable mod_vhost_alias... shared (most)
checking whether to enable mod_negotiation... shared (most)
checking whether to enable mod_dir... shared
checking whether to enable mod_imagemap... no
checking whether to enable mod_actions... shared (most)
checking whether to enable mod_speling... shared (most)
checking whether to enable mod_userdir... shared (most)
checking whether to enable mod_alias... shared
checking whether to enable mod_rewrite... shared (most)
  adding "-I$(top_srcdir)/modules/mappers" to INCLUDES
configure: 
configure: Restore user-defined environment settings...
configure: 
  restoring CPPFLAGS to ""
  setting EXTRA_CPPFLAGS to " -DLINUX -D_REENTRANT -D_GNU_SOURCE"
  restoring CFLAGS to ""
  setting EXTRA_CFLAGS to " -g -O2 -pthread"
  restoring CXXFLAGS to ""
  setting EXTRA_CXXFLAGS to ""
  restoring LDFLAGS to ""
  setting EXTRA_LDFLAGS to " "
  restoring LIBS to ""
  setting EXTRA_LIBS to ""
  restoring INCLUDES to ""
  setting EXTRA_INCLUDES to "-I. -I$(top_srcdir)/os/$(OS_DIR) -I$(top_srcdir)/include -I/usr/local/apr/include/apr-1 -I/usr/local/apr-util/include/apr-1 -I$(top_srcdir)/modules/aaa -I$(top_srcdir)/modules/cache -I$(top_srcdir)/modules/core -I$(top_srcdir)/modules/database -I$(top_srcdir)/modules/filters -I$(top_srcdir)/modules/ldap -I$(top_srcdir)/modules/loggers -I$(top_srcdir)/modules/lua -I$(top_srcdir)/modules/proxy -I$(top_srcdir)/modules/http2 -I$(top_srcdir)/modules/session -I$(top_srcdir)/modules/ssl -I$(top_srcdir)/modules/test -I$(top_srcdir)/server -I$(top_srcdir)/modules/md -I$(top_srcdir)/modules/arch/unix -I$(top_srcdir)/modules/dav/main -I$(top_srcdir)/modules/generators -I$(top_srcdir)/modules/mappers"
configure: 
configure: Construct makefiles and header files...
configure: 
configure: creating config_vars.mk
configure: creating ./config.status
creating modules/aaa/Makefile
creating modules/arch/win32/Makefile
creating modules/cache/Makefile
creating modules/core/Makefile
creating modules/database/Makefile
creating modules/debugging/Makefile
creating modules/echo/Makefile
creating modules/examples/Makefile
creating modules/experimental/Makefile
creating modules/filters/Makefile
creating modules/http/Makefile
creating modules/ldap/Makefile
creating modules/loggers/Makefile
creating modules/lua/Makefile
creating modules/metadata/Makefile
creating modules/proxy/Makefile
creating modules/session/Makefile
creating modules/slotmem/Makefile
creating modules/ssl/Makefile
creating modules/test/Makefile
creating os/unix/Makefile
creating modules/http2/Makefile
creating modules/md/Makefile
creating modules/proxy/balancers/Makefile
creating server/mpm/Makefile
creating server/mpm/event/Makefile
creating modules/arch/unix/Makefile
creating modules/cluster/Makefile
creating modules/dav/main/Makefile
creating modules/generators/Makefile
creating modules/dav/fs/Makefile
creating modules/dav/lock/Makefile
creating modules/mappers/Makefile
creating Makefile
creating modules/Makefile
creating srclib/Makefile
creating os/Makefile
creating server/Makefile
creating support/Makefile
creating test/Makefile
config.status: creating docs/conf/httpd.conf
config.status: creating docs/conf/extra/httpd-autoindex.conf
config.status: creating docs/conf/extra/httpd-dav.conf
config.status: creating docs/conf/extra/httpd-default.conf
config.status: creating docs/conf/extra/httpd-info.conf
config.status: creating docs/conf/extra/httpd-languages.conf
config.status: creating docs/conf/extra/httpd-manual.conf
config.status: creating docs/conf/extra/httpd-mpm.conf
config.status: creating docs/conf/extra/httpd-multilang-errordoc.conf
config.status: creating docs/conf/extra/httpd-ssl.conf
config.status: creating docs/conf/extra/httpd-userdir.conf
config.status: creating docs/conf/extra/httpd-vhosts.conf
config.status: creating docs/conf/extra/proxy-html.conf
config.status: creating include/ap_config_layout.h
config.status: creating support/apxs
config.status: creating support/apachectl
config.status: creating support/dbmmanage
config.status: creating support/envvars-std
config.status: creating support/log_server_status
config.status: creating support/logresolve.pl
config.status: creating support/phf_abuse_log.cgi
config.status: creating support/split-logfile
config.status: creating build/rules.mk
config.status: creating build/pkg/pkginfo
config.status: creating build/config_vars.sh
config.status: creating include/ap_config_auto.h
config.status: executing default commands
configure: summary of build options:

    Server Version: 2.4.39
    Install prefix: /usr/local/httpd2.4
    C compiler:     gcc -std=gnu99
    CFLAGS:          -g -O2 -pthread  
    CPPFLAGS:        -DLINUX -D_REENTRANT -D_GNU_SOURCE  
    LDFLAGS:           
    LIBS:             
    C preprocessor: gcc -E

[root@linux-01 httpd-2.4.39]# echo $?
0

[root@linux-01 httpd-2.4.39]# make && make install
省略


[root@linux-01 httpd-2.4.39]# ls /usr/local/httpd2.4/
bin  build  cgi-bin  conf  error  htdocs  icons  include  logs  man  manual  modules
[root@linux-01 httpd-2.4.39]# 

4.5.4 启动httpd服务,监听的端口为80

[root@linux-01 httpd-2.4.39]# /usr/local/httpd2.4/bin/apachectl  start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::c3b2:5f24:81d8:762%ens33. Set the 'ServerName' directive globally to suppress this message
[root@linux-01 httpd-2.4.39]# ps aux |grep http
root      56461  0.0  0.1  97760  2588 ?        Ss   01:51   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    56462  0.0  0.2 386672  4424 ?        Sl   01:51   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    56463  0.0  0.2 386672  4424 ?        Sl   01:51   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    56464  0.0  0.2 386672  4420 ?        Sl   01:51   0:00 /usr/local/httpd2.4/bin/httpd -k start
root      56547  0.0  0.0 112728   988 pts/0    S+   01:51   0:00 grep --color=auto http
[root@linux-01 httpd-2.4.39]# netstat  -ltnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      1/systemd           
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      7229/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      6850/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      6847/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      7219/master         
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      7534/sshd: root@pts 
tcp6       0      0 :::111                  :::*                    LISTEN      1/systemd           
tcp6       0      0 :::80                   :::*                    LISTEN      56461/httpd         
tcp6       0      0 :::22                   :::*                    LISTEN      6850/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      6847/cupsd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      7219/master         
tcp6       0      0 ::1:6010                :::*                    LISTEN      7534/sshd: root@pts 
[root@linux-01 httpd-2.4.39]# 

4.6 查看httpd模块

[root@linux-001 php-5.6.39]# /usr/local/httpd2.4/bin/httpd -M
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::8db4:d867:92de:d2d1%ens33. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 mpm_event_module (static)
 authn_file_module (shared)
 authn_core_module (shared)
 authz_host_module (shared)
 authz_groupfile_module (shared)
 authz_user_module (shared)
 authz_core_module (shared)
 access_compat_module (shared)
 auth_basic_module (shared)
 reqtimeout_module (shared)
 filter_module (shared)
 mime_module (shared)
 log_config_module (shared)
 env_module (shared)
 headers_module (shared)
 setenvif_module (shared)
 version_module (shared)
 unixd_module (shared)
 status_module (shared)
 autoindex_module (shared)
 dir_module (shared)
 alias_module (shared)
 php5_module (shared)
[root@linux-001 php-5.6.39]# 

5 php5 编译安装

5.1 下载php5

[root@linux-001 src]# wget http://cn2.php.net/distributions/php-5.6.39.tar.bz2
--2019-05-07 14:59:38--  http://cn2.php.net/distributions/php-5.6.39.tar.bz2
正在解析主机 cn2.php.net (cn2.php.net)... 119.81.61.41, 2a02:cb40:200::1ad
正在连接 cn2.php.net (cn2.php.net)|119.81.61.41|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 301 Moved Permanently
位置:https://www.php.net/distributions/php-5.6.39.tar.bz2 [跟随至新的 URL]
--2019-05-07 14:59:39--  https://www.php.net/distributions/php-5.6.39.tar.bz2
正在解析主机 www.php.net (www.php.net)... 119.81.61.41, 2a02:cb40:200::1ad
正在连接 www.php.net (www.php.net)|119.81.61.41|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:15056476 (14M) [application/octet-stream]
正在保存至: “php-5.6.39.tar.bz2”

20% [==================>                                                                         ] 3,161,794    546KB/s 用时 5.7s   

2019-05-07 15:14:46 (545 KB/s) - 在 3161794/15056476 字节处发生读取错误 (成功)。重试中。

--2019-05-07 15:14:47--  (尝试次数: 2)  https://www.php.net/distributions/php-5.6.39.tar.bz2
正在连接 www.php.net (www.php.net)|119.81.61.41|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 206 Partial Content
长度:15056476 (14M),剩余 11894682 (11M) [application/octet-stream]
正在保存至: “php-5.6.39.tar.bz2”

100%[+++++++++++++++++++========================================================================>] 15,056,476   381KB/s 用时 25s    

2019-05-07 15:15:13 (456 KB/s) - 已保存 “php-5.6.39.tar.bz2” [15056476/15056476])

5.2 解压文件

[root@linux-001 src]# tar -jxvf php-5.6.39.tar.bz2 
……
php-5.6.39/NEWS
php-5.6.39/server-tests.php
php-5.6.39/php.ini-development
php-5.6.39/EXTENSIONS
php-5.6.39/README.namespaces
php-5.6.39/pear/
php-5.6.39/pear/install-pear.txt
php-5.6.39/pear/install-pear-nozlib.phar
php-5.6.39/pear/fetch.php
php-5.6.39/pear/Makefile.frag
php-5.6.39/README.SUBMITTING_PATCH

5.3 编译安装

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

[root@linux-001 src]# cd php-5.6.39/
[root@linux-001 php-5.6.39]# ls
acinclude.m4      generated_lists  mkinstalldirs             README.NEW-OUTPUT-API             server-tests-config.php
aclocal.m4        genfiles         netware                   README.PARAMETER_PARSING_API      server-tests.php
build             header           NEWS                      README.REDIST.BINS                snapshot
buildconf         INSTALL          pear                      README.RELEASE_PROCESS            stamp-h.in
buildconf.bat     install-sh       php5.spec.in              README.SELF-CONTAINED-EXTENSIONS  stub.c
CODING_STANDARDS  LICENSE          php.gif                   README.STREAMS                    tests
config.guess      ltmain.sh        php.ini-development       README.SUBMITTING_PATCH           travis
config.sub        main             php.ini-production        README.TESTING                    TSRM
configure         makedist         README.EXT_SKEL           README.TESTING2                   UPGRADING
configure.in      Makefile.frag    README.GIT-RULES          README.UNIX-BUILD-SYSTEM          UPGRADING.INTERNALS
CREDITS           Makefile.gcov    README.input_filter       README.WIN32-BUILD-SYSTEM         vcsclean
ext               Makefile.global  README.MAILINGLIST_RULES  run-tests.php                     win32
EXTENSIONS        makerpm          README.md                 sapi                              Zend
footer            missing          README.namespaces         scripts


[root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... yes
checking for xml2-config path... 
configure: error: xml2-config not found. Please check your libxml2 installation.

5.4 上文的报错提示缺少libxml2-devel

[root@linux-001 php-5.6.39]# yum install -y libxml2-devel 
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 libxml2-devel.x86_64.0.2.9.1-6.el7_2.3 将被 安装
--> 正在处理依赖关系 xz-devel,它被软件包 libxml2-devel-2.9.1-6.el7_2.3.x86_64 需要
--> 正在检查事务
---> 软件包 xz-devel.x86_64.0.5.2.2-1.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                            架构                        版本                                 源                         大小
=====================================================================================================================================
正在安装:
 libxml2-devel                      x86_64                      2.9.1-6.el7_2.3                      base                      1.0 M
为依赖而安装:
 xz-devel                           x86_64                      5.2.2-1.el7                          base                       46 k

事务概要
=====================================================================================================================================
安装  1 软件包 (+1 依赖软件包)

总下载量:1.1 M
安装大小:8.9 M
Downloading packages:
(1/2): xz-devel-5.2.2-1.el7.x86_64.rpm                                                                        |  46 kB  00:00:00     
(2/2): libxml2-devel-2.9.1-6.el7_2.3.x86_64.rpm                                                               | 1.0 MB  00:00:26     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                  42 kB/s | 1.1 MB  00:00:26     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : xz-devel-5.2.2-1.el7.x86_64                                                                                      1/2 
  正在安装    : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                             2/2 
  验证中      : xz-devel-5.2.2-1.el7.x86_64                                                                                      1/2 
  验证中      : libxml2-devel-2.9.1-6.el7_2.3.x86_64                                                                             2/2 

已安装:
  libxml2-devel.x86_64 0:2.9.1-6.el7_2.3                                                                                             

作为依赖被安装:
  xz-devel.x86_64 0:5.2.2-1.el7                                                                                                      

完毕!
[root@linux-001 php-5.6.39]# 


[root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
Configuring extensions
checking size of long... (cached) 8
checking size of int... (cached) 4
checking for int32_t... yes
checking for uint32_t... yes
checking for sys/types.h... (cached) yes
checking for inttypes.h... (cached) yes
checking for stdint.h... (cached) yes
checking for string.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for strtoll... yes
checking for atoll... yes
checking for strftime... (cached) yes
checking which regex library to use... php
checking whether to enable LIBXML support... yes
checking libxml2 install dir... yes
checking for xml2-config path... /usr/bin/xml2-config
checking whether libxml build works... yes
checking for OpenSSL support... yes
checking for Kerberos support... no
checking whether to use system default cipher list instead of hardcoded value... no
checking for DSA_get_default_method in -lssl... no
checking for X509_free in -lcrypto... no
checking for RAND_egd... no
checking for pkg-config... /usr/bin/pkg-config
configure: error: Cannot find OpenSSL's <evp.h>

5.5 上文的报错提示缺少openssl

[root@linux-001 php-5.6.39]# yum install  -y openssl-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 openssl-devel.x86_64.1.1.0.2k-16.el7_6.1 将被 安装
--> 正在处理依赖关系 openssl-libs(x86-64) = 1:1.0.2k-16.el7_6.1,它被软件包 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64 需要
--> 正在处理依赖关系 krb5-devel(x86-64),它被软件包 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64 需要
--> 正在检查事务
---> 软件包 krb5-devel.x86_64.0.1.15.1-37.el7_6 将被 安装
--> 正在处理依赖关系 libkadm5(x86-64) = 1.15.1-37.el7_6,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
--> 正在处理依赖关系 krb5-libs(x86-64) = 1.15.1-37.el7_6,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
--> 正在处理依赖关系 libverto-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
--> 正在处理依赖关系 libselinux-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
--> 正在处理依赖关系 libcom_err-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
--> 正在处理依赖关系 keyutils-libs-devel,它被软件包 krb5-devel-1.15.1-37.el7_6.x86_64 需要
---> 软件包 openssl-libs.x86_64.1.1.0.2k-16.el7 将被 升级
--> 正在处理依赖关系 openssl-libs(x86-64) = 1:1.0.2k-16.el7,它被软件包 1:openssl-1.0.2k-16.el7.x86_64 需要
---> 软件包 openssl-libs.x86_64.1.1.0.2k-16.el7_6.1 将被 更新
--> 正在检查事务
---> 软件包 keyutils-libs-devel.x86_64.0.1.5.8-3.el7 将被 安装
---> 软件包 krb5-libs.x86_64.0.1.15.1-34.el7 将被 升级
---> 软件包 krb5-libs.x86_64.0.1.15.1-37.el7_6 将被 更新
---> 软件包 libcom_err-devel.x86_64.0.1.42.9-13.el7 将被 安装
---> 软件包 libkadm5.x86_64.0.1.15.1-37.el7_6 将被 安装
---> 软件包 libselinux-devel.x86_64.0.2.5-14.1.el7 将被 安装
--> 正在处理依赖关系 libsepol-devel(x86-64) >= 2.5-10,它被软件包 libselinux-devel-2.5-14.1.el7.x86_64 需要
--> 正在处理依赖关系 pkgconfig(libsepol),它被软件包 libselinux-devel-2.5-14.1.el7.x86_64 需要
---> 软件包 libverto-devel.x86_64.0.0.2.5-4.el7 将被 安装
---> 软件包 openssl.x86_64.1.1.0.2k-16.el7 将被 升级
---> 软件包 openssl.x86_64.1.1.0.2k-16.el7_6.1 将被 更新
--> 正在检查事务
---> 软件包 libsepol-devel.x86_64.0.2.5-10.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                              架构                    版本                                    源                        大小
=====================================================================================================================================
正在安装:
 openssl-devel                        x86_64                  1:1.0.2k-16.el7_6.1                     updates                  1.5 M
为依赖而安装:
 keyutils-libs-devel                  x86_64                  1.5.8-3.el7                             base                      37 k
 krb5-devel                           x86_64                  1.15.1-37.el7_6                         updates                  271 k
 libcom_err-devel                     x86_64                  1.42.9-13.el7                           base                      31 k
 libkadm5                             x86_64                  1.15.1-37.el7_6                         updates                  178 k
 libselinux-devel                     x86_64                  2.5-14.1.el7                            base                     187 k
 libsepol-devel                       x86_64                  2.5-10.el7                              base                      77 k
 libverto-devel                       x86_64                  0.2.5-4.el7                             base                      12 k
为依赖而更新:
 krb5-libs                            x86_64                  1.15.1-37.el7_6                         updates                  803 k
 openssl                              x86_64                  1:1.0.2k-16.el7_6.1                     updates                  493 k
 openssl-libs                         x86_64                  1:1.0.2k-16.el7_6.1                     updates                  1.2 M

事务概要
=====================================================================================================================================
安装  1 软件包 (+7 依赖软件包)
升级           ( 3 依赖软件包)

总下载量:4.7 M
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/11): keyutils-libs-devel-1.5.8-3.el7.x86_64.rpm                                                            |  37 kB  00:00:00     
(2/11): krb5-devel-1.15.1-37.el7_6.x86_64.rpm                                                                 | 271 kB  00:00:00     
(3/11): libcom_err-devel-1.42.9-13.el7.x86_64.rpm                                                             |  31 kB  00:00:00     
(4/11): libselinux-devel-2.5-14.1.el7.x86_64.rpm                                                              | 187 kB  00:00:00     
(5/11): libsepol-devel-2.5-10.el7.x86_64.rpm                                                                  |  77 kB  00:00:00     
(6/11): libverto-devel-0.2.5-4.el7.x86_64.rpm                                                                 |  12 kB  00:00:00     
(7/11): libkadm5-1.15.1-37.el7_6.x86_64.rpm                                                                   | 178 kB  00:00:00     
(8/11): openssl-1.0.2k-16.el7_6.1.x86_64.rpm                                                                  | 493 kB  00:00:00     
(9/11): openssl-devel-1.0.2k-16.el7_6.1.x86_64.rpm                                                            | 1.5 MB  00:00:00     
(10/11): openssl-libs-1.0.2k-16.el7_6.1.x86_64.rpm                                                            | 1.2 MB  00:00:00     
(11/11): krb5-libs-1.15.1-37.el7_6.x86_64.rpm                                                                 | 803 kB  00:00:06     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 773 kB/s | 4.7 MB  00:00:06     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                         1/14 
  正在更新    : krb5-libs-1.15.1-37.el7_6.x86_64                                                                                2/14 
  正在安装    : libkadm5-1.15.1-37.el7_6.x86_64                                                                                 3/14 
  正在安装    : libcom_err-devel-1.42.9-13.el7.x86_64                                                                           4/14 
  正在安装    : libsepol-devel-2.5-10.el7.x86_64                                                                                5/14 
  正在安装    : libselinux-devel-2.5-14.1.el7.x86_64                                                                            6/14 
  正在安装    : libverto-devel-0.2.5-4.el7.x86_64                                                                               7/14 
  正在安装    : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                          8/14 
  正在安装    : krb5-devel-1.15.1-37.el7_6.x86_64                                                                               9/14 
  正在安装    : 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64                                                                       10/14 
  正在更新    : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                             11/14 
  清理        : 1:openssl-1.0.2k-16.el7.x86_64                                                                                 12/14 
  清理        : krb5-libs-1.15.1-34.el7.x86_64                                                                                 13/14 
  清理        : 1:openssl-libs-1.0.2k-16.el7.x86_64                                                                            14/14 
  验证中      : 1:openssl-1.0.2k-16.el7_6.1.x86_64                                                                              1/14 
  验证中      : keyutils-libs-devel-1.5.8-3.el7.x86_64                                                                          2/14 
  验证中      : libverto-devel-0.2.5-4.el7.x86_64                                                                               3/14 
  验证中      : krb5-libs-1.15.1-37.el7_6.x86_64                                                                                4/14 
  验证中      : libkadm5-1.15.1-37.el7_6.x86_64                                                                                 5/14 
  验证中      : krb5-devel-1.15.1-37.el7_6.x86_64                                                                               6/14 
  验证中      : libselinux-devel-2.5-14.1.el7.x86_64                                                                            7/14 
  验证中      : 1:openssl-libs-1.0.2k-16.el7_6.1.x86_64                                                                         8/14 
  验证中      : libsepol-devel-2.5-10.el7.x86_64                                                                                9/14 
  验证中      : libcom_err-devel-1.42.9-13.el7.x86_64                                                                          10/14 
  验证中      : 1:openssl-devel-1.0.2k-16.el7_6.1.x86_64                                                                       11/14 
  验证中      : 1:openssl-libs-1.0.2k-16.el7.x86_64                                                                            12/14 
  验证中      : krb5-libs-1.15.1-34.el7.x86_64                                                                                 13/14 
  验证中      : 1:openssl-1.0.2k-16.el7.x86_64                                                                                 14/14 

已安装:
  openssl-devel.x86_64 1:1.0.2k-16.el7_6.1                                                                                           

作为依赖被安装:
  keyutils-libs-devel.x86_64 0:1.5.8-3.el7     krb5-devel.x86_64 0:1.15.1-37.el7_6        libcom_err-devel.x86_64 0:1.42.9-13.el7    
  libkadm5.x86_64 0:1.15.1-37.el7_6            libselinux-devel.x86_64 0:2.5-14.1.el7     libsepol-devel.x86_64 0:2.5-10.el7         
  libverto-devel.x86_64 0:0.2.5-4.el7         

作为依赖被升级:
  krb5-libs.x86_64 0:1.15.1-37.el7_6        openssl.x86_64 1:1.0.2k-16.el7_6.1        openssl-libs.x86_64 1:1.0.2k-16.el7_6.1       

完毕!
[root@linux-001 php-5.6.39]# 


[root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
checking for zlib version >= 1.2.0.4... 1.2.7
checking for gzgets in -lz... yes
checking whether to enable bc style precision math functions... no
checking for BZip2 support... yes
checking for BZip2 in default path... not found
configure: error: Please reinstall the BZip2 distribution

5.6 上文的报错提示缺少bzip2

[root@linux-001 php-5.6.39]# yum install -y bzip2-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 bzip2-devel.x86_64.0.1.0.6-13.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                           架构                         版本                                源                          大小
=====================================================================================================================================
正在安装:
 bzip2-devel                       x86_64                       1.0.6-13.el7                        base                       218 k

事务概要
=====================================================================================================================================
安装  1 软件包

总下载量:218 k
安装大小:382 k
Downloading packages:
bzip2-devel-1.0.6-13.el7.x86_64.rpm                                                                           | 218 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : bzip2-devel-1.0.6-13.el7.x86_64                                                                                  1/1 
  验证中      : bzip2-devel-1.0.6-13.el7.x86_64                                                                                  1/1 

已安装:
  bzip2-devel.x86_64 0:1.0.6-13.el7                                                                                                  

完毕!


[root@linux-001 php-5.6.39]# [root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-vpx-dir=<DIR>
configure: error: jpeglib.h not found.

5.7 上文的报错提示缺少libjpeg

[root@linux-001 php-5.6.39]# yum install -y libjpeg-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 libjpeg-turbo-devel.x86_64.0.1.2.90-6.el7 将被 安装
--> 正在处理依赖关系 libjpeg-turbo(x86-64) = 1.2.90-6.el7,它被软件包 libjpeg-turbo-devel-1.2.90-6.el7.x86_64 需要
--> 正在处理依赖关系 libjpeg.so.62()(64bit),它被软件包 libjpeg-turbo-devel-1.2.90-6.el7.x86_64 需要
--> 正在检查事务
---> 软件包 libjpeg-turbo.x86_64.0.1.2.90-6.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                                 架构                       版本                              源                        大小
=====================================================================================================================================
正在安装:
 libjpeg-turbo-devel                     x86_64                     1.2.90-6.el7                      base                      99 k
为依赖而安装:
 libjpeg-turbo                           x86_64                     1.2.90-6.el7                      base                     134 k

事务概要
=====================================================================================================================================
安装  1 软件包 (+1 依赖软件包)

总下载量:233 k
安装大小:657 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): libjpeg-turbo-devel-1.2.90-6.el7.x86_64.rpm                                                            |  99 kB  00:00:00     
(2/2): libjpeg-turbo-1.2.90-6.el7.x86_64.rpm                                                                  | 134 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 953 kB/s | 233 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libjpeg-turbo-1.2.90-6.el7.x86_64                                                                                1/2 
  正在安装    : libjpeg-turbo-devel-1.2.90-6.el7.x86_64                                                                          2/2 
  验证中      : libjpeg-turbo-devel-1.2.90-6.el7.x86_64                                                                          1/2 
  验证中      : libjpeg-turbo-1.2.90-6.el7.x86_64                                                                                2/2 

已安装:
  libjpeg-turbo-devel.x86_64 0:1.2.90-6.el7                                                                                          

作为依赖被安装:
  libjpeg-turbo.x86_64 0:1.2.90-6.el7                                                                                                

完毕!


[root@linux-001 php-5.6.39]# [root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
checking for T1lib support... no
checking whether to enable truetype string function in GD... yes
checking whether to enable JIS-mapped Japanese font support in GD... no
If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
configure: error: png.h not found.
[root@linux-001 php-5.6.39]# 


5.8 上文的报错提示缺少libpng

[root@linux-001 php-5.6.39]# yum install -y  libpng-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 libpng-devel.x86_64.2.1.5.13-7.el7_2 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                           架构                        版本                                  源                         大小
=====================================================================================================================================
正在安装:
 libpng-devel                      x86_64                      2:1.5.13-7.el7_2                      base                      122 k

事务概要
=====================================================================================================================================
安装  1 软件包

总下载量:122 k
安装大小:211 k
Downloading packages:
libpng-devel-1.5.13-7.el7_2.x86_64.rpm                                                                        | 122 kB  00:00:05     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                             1/1 
  验证中      : 2:libpng-devel-1.5.13-7.el7_2.x86_64                                                                             1/1 

已安装:
  libpng-devel.x86_64 2:1.5.13-7.el7_2                                                                                               

完毕!



[root@linux-001 php-5.6.39]# [root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
If configure fails try --with-vpx-dir=<DIR>
checking for jpeg_read_header in -ljpeg... yes
checking for png_write_image in -lpng... yes
If configure fails try --with-xpm-dir=<DIR>
configure: error: freetype-config not found.
[root@linux-001 php-5.6.39]# 

5.9 上文的报错提示缺少freetype

[root@linux-001 php-5.6.39]# yum install -y freetype-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 freetype-devel.x86_64.0.2.8-12.el7_6.1 将被 安装
--> 正在处理依赖关系 freetype = 2.8-12.el7_6.1,它被软件包 freetype-devel-2.8-12.el7_6.1.x86_64 需要
--> 正在检查事务
---> 软件包 freetype.x86_64.0.2.8-12.el7 将被 升级
---> 软件包 freetype.x86_64.0.2.8-12.el7_6.1 将被 更新
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                            架构                       版本                                源                           大小
=====================================================================================================================================
正在安装:
 freetype-devel                     x86_64                     2.8-12.el7_6.1                      updates                     447 k
为依赖而更新:
 freetype                           x86_64                     2.8-12.el7_6.1                      updates                     380 k

事务概要
=====================================================================================================================================
安装  1 软件包
升级           ( 1 依赖软件包)

总下载量:826 k
Downloading packages:
Delta RPMs disabled because /usr/bin/applydeltarpm not installed.
(1/2): freetype-devel-2.8-12.el7_6.1.x86_64.rpm                                                               | 447 kB  00:00:00     
(2/2): freetype-2.8-12.el7_6.1.x86_64.rpm                                                                     | 380 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 1.7 MB/s | 826 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在更新    : freetype-2.8-12.el7_6.1.x86_64                                                                                   1/3 
  正在安装    : freetype-devel-2.8-12.el7_6.1.x86_64                                                                             2/3 
  清理        : freetype-2.8-12.el7.x86_64                                                                                       3/3 
  验证中      : freetype-devel-2.8-12.el7_6.1.x86_64                                                                             1/3 
  验证中      : freetype-2.8-12.el7_6.1.x86_64                                                                                   2/3 
  验证中      : freetype-2.8-12.el7.x86_64                                                                                       3/3 

已安装:
  freetype-devel.x86_64 0:2.8-12.el7_6.1                                                                                             

作为依赖被升级:
  freetype.x86_64 0:2.8-12.el7_6.1                                                                                                   

完毕!

[root@linux-001 php-5.6.39]# [root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

……
checking for working alloca.h... (cached) yes
checking for alloca... (cached) yes
checking for working memcmp... yes
checking for stdarg.h... (cached) yes
checking for mcrypt support... yes
configure: error: mcrypt.h not found. Please reinstall libmcrypt.

5.10 上文的报错提示缺少libmcrypt

[root@linux-001 php-5.6.39]# yum install -y  libmcrypt-devel
已加载插件:fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: mirrors.163.com
 * epel: mirrors.yun-idc.com
 * extras: centos.ustc.edu.cn
 * updates: mirrors.nju.edu.cn
正在解决依赖关系
--> 正在检查事务
---> 软件包 libmcrypt-devel.x86_64.0.2.5.8-13.el7 将被 安装
--> 正在处理依赖关系 libmcrypt = 2.5.8-13.el7,它被软件包 libmcrypt-devel-2.5.8-13.el7.x86_64 需要
--> 正在处理依赖关系 libmcrypt.so.4()(64bit),它被软件包 libmcrypt-devel-2.5.8-13.el7.x86_64 需要
--> 正在检查事务
---> 软件包 libmcrypt.x86_64.0.2.5.8-13.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================
 Package                              架构                        版本                               源                         大小
=====================================================================================================================================
正在安装:
 libmcrypt-devel                      x86_64                      2.5.8-13.el7                       epel                       13 k
为依赖而安装:
 libmcrypt                            x86_64                      2.5.8-13.el7                       epel                       99 k

事务概要
=====================================================================================================================================
安装  1 软件包 (+1 依赖软件包)

总下载量:112 k
安装大小:302 k
Downloading packages:
(1/2): libmcrypt-devel-2.5.8-13.el7.x86_64.rpm                                                                |  13 kB  00:00:00     
libmcrypt-2.5.8-13.el7.x86_64. FAILED                                          
http://www.ftp.ne.jp/Linux/distributions/fedora/epel/7/x86_64/Packages/l/libmcrypt-2.5.8-13.el7.x86_64.rpm: [Errno 14] curl#56 - "Recv failure: Connection reset by peer"
正在尝试其它镜像。
(2/2): libmcrypt-2.5.8-13.el7.x86_64.rpm                                                                      |  99 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                 197 kB/s | 112 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : libmcrypt-2.5.8-13.el7.x86_64                                                                                    1/2 
  正在安装    : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                              2/2 
  验证中      : libmcrypt-devel-2.5.8-13.el7.x86_64                                                                              1/2 
  验证中      : libmcrypt-2.5.8-13.el7.x86_64                                                                                    2/2 

已安装:
  libmcrypt-devel.x86_64 0:2.5.8-13.el7                                                                                              

作为依赖被安装:
  libmcrypt.x86_64 0:2.5.8-13.el7                                                                                                    

完毕!

5.11 安装完成

[root@linux-001 php-5.6.39]# [root@linux-001 php-5.6.39]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php/etc  --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
……
Thank you for using PHP.

config.status: creating php5.spec
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/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

[root@linux-001 php-5.6.39]# make && make install
Installing PHP SAPI module:       apache2handler
/usr/local/httpd2.4/build/instdso.sh SH_LIBTOOL='/usr/local/apr/build-1/libtool' libphp5.la /usr/local/httpd2.4/modules
/usr/local/apr/build-1/libtool --mode=install install libphp5.la /usr/local/httpd2.4/modules/
libtool: install: install .libs/libphp5.so /usr/local/httpd2.4/modules/libphp5.so
libtool: install: install .libs/libphp5.lai /usr/local/httpd2.4/modules/libphp5.la
libtool: warning: remember to run 'libtool --finish /usr/local/src/php-5.6.39/libs'
chmod 755 /usr/local/httpd2.4/modules/libphp5.so
[activating module `php5' in /usr/local/httpd2.4/conf/httpd.conf]
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-zts-20131226/
Installing PHP CLI binary:        /usr/local/php/bin/
Installing PHP CLI man page:      /usr/local/php/php/man/man1/
Installing PHP CGI binary:        /usr/local/php/bin/
Installing PHP CGI man page:      /usr/local/php/php/man/man1/
Installing build environment:     /usr/local/php/lib/php/build/
Installing header files:           /usr/local/php/include/php/
Installing helper programs:       /usr/local/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php/lib/php/
[PEAR] Archive_Tar    - installed: 1.4.3
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.2
[PEAR] PEAR           - installed: 1.10.5
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
/usr/local/src/php-5.6.39/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers:           /usr/local/php/include/php/ext/pdo/

5.12 php 模块

[root@linux-001 php-5.6.39]# /usr/local/php/bin/php  -m
[PHP Modules]
bz2
Core
ctype
date
dom
ereg
exif
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

[root@linux-001 php-5.6.39]# 

5.13 php配置文件

下面两个配置文件都是在php的源码目录:
php.ini-development 适合用于开发环境
php.ini-production 适合用于生产环境

[root@linux-001 php-5.6.39]# cp php.ini-production  /usr/local/php/etc/php.ini
[root@linux-001 php-5.6.39]# /usr/local/php/bin/php -i | less
PHP Warning:  Unknown: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in Unknown on line 0






phpinfo()
PHP Version => 5.6.39

System => Linux linux-001 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64
Build Date => May  8 2019 00:15:24
Configure Command =>  './configure'  '--prefix=/usr/local/php' '--with-apxs2=/usr/local/httpd2.4/bin/apxs' '--with-config-file-path=/usr/local/php/etc' '--with-mysql=/usr/local/mysql' '--with-pdo-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-libxml-dir' '--with-gd' '--with-jpeg-dir' '--with-png-dir' '--with-freetype-dir' '--with-iconv-dir' '--with-zlib-dir' '--with-bz2' '--with-openssl' '--with-mcrypt' '--enable-soap' '--enable-gd-native-ttf' '--enable-mbstring' '--enable-sockets' '--enable-exif'
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => /usr/local/php/etc
Loaded Configuration File => /usr/local/php/etc/php.ini   //此处已经加载了配置文件
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20131106
PHP Extension => 20131226
Zend Extension => 220131226
Zend Extension Build => API220131226,TS
PHP Extension Build => API20131226,TS
Debug Build => no
Thread Safety => enabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
:

6 安装php7

6.1 下载php7

[root@linux-001 src]# wget http://cn2.php.net/distributions/php-7.3.0.tar.bz2
--2019-05-08 00:41:36--  http://cn2.php.net/distributions/php-7.3.0.tar.bz2
正在解析主机 cn2.php.net (cn2.php.net)... 119.81.61.41, 2a02:cb40:200::1ad
正在连接 cn2.php.net (cn2.php.net)|119.81.61.41|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 301 Moved Permanently
位置:https://www.php.net/distributions/php-7.3.0.tar.bz2 [跟随至新的 URL]
--2019-05-08 00:41:36--  https://www.php.net/distributions/php-7.3.0.tar.bz2
正在解析主机 www.php.net (www.php.net)... 119.81.61.41, 2a02:cb40:200::1ad
正在连接 www.php.net (www.php.net)|119.81.61.41|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:14786886 (14M) [application/octet-stream]
正在保存至: “php-7.3.0.tar.bz2”

100%[===========================================================================================>] 14,786,886   467KB/s 用时 31s    

2019-05-08 00:42:08 (461 KB/s) - 已保存 “php-7.3.0.tar.bz2” [14786886/14786886])

6.2 解压php7

[root@linux-001 php-7.3.0]# tar -jxvf  php-7.3.0.tar.bz2 
……
php-7.3.0/Zend/zend_long.h
php-7.3.0/Zend/zend_extensions.h
php-7.3.0/Zend/zend_vm_trace_map.h
php-7.3.0/Zend/zend_alloc.c
php-7.3.0/Zend/zend_builtin_functions.h
php-7.3.0/Zend/zend_ini_parser.c
php-7.3.0/Zend/zend_errors.h
php-7.3.0/Zend/zend_smart_str.h
php-7.3.0/Zend/zend_generators.h
php-7.3.0/Zend/zend_ptr_stack.h
php-7.3.0/Zend/zend_stream.c
php-7.3.0/Zend/zend_build.h
php-7.3.0/Zend/acinclude.m4
php-7.3.0/Zend/zend_vm_trace_handlers.h
php-7.3.0/Zend/zend_objects_API.h
php-7.3.0/Zend/zend_ini_parser.output
php-7.3.0/Zend/zend_ini_scanner.c
php-7.3.0/Zend/zend_float.h
php-7.3.0/Zend/zend_alloc.h
php-7.3.0/acinclude.m4
php-7.3.0/makedist
[root@linux-001 src]# 
[root@linux-001 src]# cd php-7.3.0/

6.3 安装php7

[root@linux-001 php-7.3.0]# ./configure --prefix=/usr/local/php7 --with-apxs2=/usr/local/httpd2.4/bin/apxs --with-config-file-path=/usr/local/php7/etc  --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif
……
Thank you for using PHP.

config.status: creating php7.spec
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/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
configure: WARNING: unrecognized options: --with-mcrypt, --enable-gd-native-ttf


[root@linux-001 php-7.3.0]# make && make install
……
Installing PHP SAPI module:       apache2handler
/usr/local/httpd2.4/build/instdso.sh SH_LIBTOOL='/usr/local/apr/build-1/libtool' libphp7.la /usr/local/httpd2.4/modules
/usr/local/apr/build-1/libtool --mode=install install libphp7.la /usr/local/httpd2.4/modules/
libtool: install: install .libs/libphp7.so /usr/local/httpd2.4/modules/libphp7.so
libtool: install: install .libs/libphp7.lai /usr/local/httpd2.4/modules/libphp7.la
libtool: warning: remember to run 'libtool --finish /usr/local/src/php-7.3.0/libs'
chmod 755 /usr/local/httpd2.4/modules/libphp7.so
[activating module `php7' in /usr/local/httpd2.4/conf/httpd.conf]
Installing shared extensions:     /usr/local/php7/lib/php/extensions/no-debug-zts-20180731/
Installing PHP CLI binary:        /usr/local/php7/bin/
Installing PHP CLI man page:      /usr/local/php7/php/man/man1/
Installing phpdbg binary:         /usr/local/php7/bin/
Installing phpdbg man page:       /usr/local/php7/php/man/man1/
Installing PHP CGI binary:        /usr/local/php7/bin/
Installing PHP CGI man page:      /usr/local/php7/php/man/man1/
Installing build environment:     /usr/local/php7/lib/php/build/
Installing header files:          /usr/local/php7/include/php/
Installing helper programs:       /usr/local/php7/bin/
  program: phpize
  program: php-config
Installing man pages:             /usr/local/php7/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PEAR environment:      /usr/local/php7/lib/php/

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in phar:///usr/local/src/php-7.3.0/pear/install-pear-nozlib.phar/PEAR/PackageFile/v2/Validator.php on line 1933
[PEAR] Archive_Tar    - installed: 1.4.3
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.2
[PEAR] PEAR           - installed: 1.10.5
Wrote PEAR system config file at: /usr/local/php7/etc/pear.conf
You may want to add: /usr/local/php7/lib/php to your php.ini include_path
/usr/local/src/php-7.3.0/build/shtool install -c ext/phar/phar.phar /usr/local/php7/bin
ln -s -f phar.phar /usr/local/php7/bin/phar
Installing PDO headers:           /usr/local/php7/include/php/ext/pdo/
[root@linux-001 php-7.3.0]# 

6.4 php7加载模块

[root@linux-001 php-7.3.0]# /usr/local/php7/bin/php -m
[PHP Modules]
bz2
Core
ctype
date
dom
exif
fileinfo
filter
gd
hash
iconv
json
libxml
mbstring
mysqli
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
Reflection
session
SimpleXML
soap
sockets
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

[root@linux-001 php-7.3.0]# 

7 apache 和 php 结合

7.1 apache配置文件中的ServerName

[root@linux-001 php-7.3.0]# /usr/local/httpd2.4/bin/apachectl start
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::8db4:d867:92de:d2d1%ens33. Set the 'ServerName' directive globally to suppress this message
httpd (pid 60625) already running
[root@linux-001 php-7.3.0]# 

在这里插入图片描述

7.2 apache服务启动,浏览器是否可以访问?

[root@linux-001 php-7.3.0]# /usr/local/httpd2.4/bin/apachectl  -t  //检查配置文件
Syntax OK
[root@linux-001 php-7.3.0]# /usr/local/httpd2.4/bin/apachectl  start
[root@linux-001 php-7.3.0]# ps aux |grep httpd
root      60625  0.0  0.4 253824  8948 ?        Ss   01:27   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    60629  0.0  0.4 540652  8932 ?        Sl   01:27   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    60630  0.0  0.4 540652  8932 ?        Sl   01:27   0:00 /usr/local/httpd2.4/bin/httpd -k start
daemon    60631  0.0  0.4 540652  8932 ?        Sl   01:27   0:00 /usr/local/httpd2.4/bin/httpd -k start
root      60718  0.0  0.0 112724   988 pts/0    R+   01:27   0:00 grep --color=auto httpd

在这里插入图片描述

7.3 是什么原因导致无法访问?

拍错方法:
1.windows是否可以ping通地址?
2.telnet 80端口是否可以通?
3.虚拟机是否放行了80端口?

[root@linux-001 php-7.3.0]# iptables -nvL
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
38634   71M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            state RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0           
    2   120 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
    1    52 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            state NEW tcp dpt:22
 1263  321K REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-host-prohibited

Chain OUTPUT (policy ACCEPT 35950 packets, 8196K bytes)
 pkts bytes target     prot opt in     out     source               destination         
[root@linux-001 php-7.3.0]# 
[root@linux-001 php-7.3.0]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT
[root@linux-001 php-7.3.0]# 

在这里插入图片描述

7.4 上图可以正常访问,这是什么原因呢?

配置文件中的此处为:Require all granted
在这里插入图片描述
如果把配置文件中的此处为:Require all granted 修改为 Require all denied,查看结果如下。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在 配置文件httpd.conf 还需要把此处更改为granted;否则会出现403状态码,一般为200;
在这里插入图片描述

7.5 检查php5是否被调用

配置文件中添加一行:AddType application/x-httpd-php .php
在这里插入图片描述

[root@linux-001 httpd2.4]# vim /usr/local/httpd2.4/htdocs/1.php

<?php
phpinfo();
?>

[root@linux-001 httpd2.4]# /usr/local/httpd2.4/bin/apachectl  -t   //检查配置文件
Syntax OK
[root@linux-001 httpd2.4]# /usr/local/httpd2.4/bin/apachectl  graceful  // 重新加载配置文件
[root@linux-001 httpd2.4]# 

在这里插入图片描述

7.6 检查php7是否被调用

修改配置文件中的下面内容,由于php5和php7不可以同时被调用。
#LoadModule php5_module modules/libphp5.so
LoadModule php7_module modules/libphp7.so
在这里插入图片描述

[root@linux-001 httpd2.4]# /usr/local/httpd2.4/bin/apachectl  -t
Syntax OK
[root@linux-001 httpd2.4]# /usr/local/httpd2.4/bin/apachectl  graceful
[root@linux-001 httpd2.4]# 

在这里插入图片描述

7.7 浏览器无法解析php原因

1.查看有没有加载php模块;
2.查看/usr/local/httpd2.4/modules/没有php模块文件;
3.在httpd.conf的配置文件中,是否有加载模块配置 LoadModule php5_module modules/libphp5.so;
4.在httpd.conf的配置文件中,是否有此配置AddType application/x-httpd-php .php;
5.在httpd.conf的配置文件中,此配置是否有 index.php

<IfModule dir_module>
DirectoryIndex index.html index.php //能够跳转到索引页
</IfModule>

课后总结

1.mysql5.7版本和之前版本初始化的不同: ./bin/mysqld --initialize --user=mysql --datadir=/data/mysql

mysql5.7版本更改用户密码:update user set authentication_string=password(‘123333’) where user=‘root’;

2.版本常识:http://www.05bk.com/520.html

3.yum 安装 mariadb

[root@linux-01 ~]# wget -O - https://downloads.mariadb.com/MariaDB/mariadb_repo_setup |sh
--2019-05-07 22:46:48--  https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
正在解析主机 downloads.mariadb.com (downloads.mariadb.com)... 51.255.85.11
正在连接 downloads.mariadb.com (downloads.mariadb.com)|51.255.85.11|:443... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:17783 (17K) [application/octet-stream]
正在保存至: “STDOUT”

100%[========================================================================================================>] 17,783      --.-K/s 用时 0s      

2019-05-07 22:46:51 (197 MB/s) - 已写入至标准输出 [17783/17783]

[info] Repository file successfully written to /etc/yum.repos.d/mariadb.repo.
[info] Adding trusted package signing keys...
[info] Succeessfully added trusted package signing keys.

[root@linux-01 ~]# yum list |grep MariaDB
MariaDB-backup.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-backup-debuginfo.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-cassandra-engine.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-cassandra-engine-debuginfo.x86_64   10.3.14-1.el7.centos       mariadb-main
MariaDB-client.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-client-debuginfo.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-common.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-common-debuginfo.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-compat.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-connect-engine.x86_64               10.3.14-1.el7.centos       mariadb-main
MariaDB-connect-engine-debuginfo.x86_64     10.3.14-1.el7.centos       mariadb-main
MariaDB-cracklib-password-check.x86_64      10.3.14-1.el7.centos       mariadb-main
MariaDB-cracklib-password-check-debuginfo.x86_64
MariaDB-devel.x86_64                        10.3.14-1.el7.centos       mariadb-main
MariaDB-devel-debuginfo.x86_64              10.3.14-1.el7.centos       mariadb-main
MariaDB-gssapi-server.x86_64                10.3.14-1.el7.centos       mariadb-main
MariaDB-gssapi-server-debuginfo.x86_64      10.3.14-1.el7.centos       mariadb-main
MariaDB-oqgraph-engine.x86_64               10.3.14-1.el7.centos       mariadb-main
MariaDB-oqgraph-engine-debuginfo.x86_64     10.3.14-1.el7.centos       mariadb-main
MariaDB-rocksdb-engine.x86_64               10.3.14-1.el7.centos       mariadb-main
MariaDB-rocksdb-engine-debuginfo.x86_64     10.3.14-1.el7.centos       mariadb-main
MariaDB-server.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-server-debuginfo.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-shared.x86_64                       10.3.14-1.el7.centos       mariadb-main
MariaDB-shared-debuginfo.x86_64             10.3.14-1.el7.centos       mariadb-main
MariaDB-test.x86_64                         10.3.14-1.el7.centos       mariadb-main
MariaDB-test-debuginfo.x86_64               10.3.14-1.el7.centos       mariadb-main
MariaDB-tokudb-engine.x86_64                10.3.14-1.el7.centos       mariadb-main
MariaDB-tokudb-engine-debuginfo.x86_64      10.3.14-1.el7.centos       mariadb-main

展开阅读全文

没有更多推荐了,返回首页