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

LAMP架构学习预习内容1.LAMP架构介绍2.mysql5.6.43二进制编码包安装2.1下载mysql的二进制编码包2.2解打包压缩文件2.3复制文件到/usr/local/mysql2.4创建mysql用户和数据位置2.5mysql初始化,安装perl-Data-Dumper.x86_642.6修改配置文件2.7复制启动脚本,注意启动脚本的权限是7552.8可以把服务添加到系统列表2.9启动...

学习笔记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.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqld_safe.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqlimport.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_waitpid.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_config_editor.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysqldump.1mysql-5.6.43-linux-glibc2.12-x86_64/man/man1/mysql_plugin.1mysql-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/mysqlFATAL 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 dumperRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationperl-Data-Dumper.x86_64  2.145-3.el7  base  perl-Data-Dumper-Concise.noarch2.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.noarch0.81-17.el7  base  [root@linux-001 mysql]# [root@linux-001 mysql]# yum install -y perl-Data-Dumper.x86_64已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading mirror speeds from cached hostfileepel/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.combase | 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 kDownloading 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 checkRunning transaction testTransaction test succeededRunning transaction  正在安装 : perl-Data-Dumper-2.145-3.el7.x86_641/1验证中: perl-Data-Dumper-2.145-3.el7.x86_641/1 已安装:  perl-Data-Dumper.x86_64 0:2.145-3.el7 完毕![root@linux-001 mysql]# ./scripts/mysql_install_db  --user=mysql --datadir=/data/mysqlInstalling 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 pages2019-05-06 19:42:37 84040 [Note] InnoDB: The InnoDB memory heap is disabled2019-05-06 19:42:37 84040 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2019-05-06 19:42:37 84040 [Note] InnoDB: Memory barrier is not used2019-05-06 19:42:37 84040 [Note] InnoDB: Compressed tables use zlib 1.2.112019-05-06 19:42:37 84040 [Note] InnoDB: Using Linux native AIO2019-05-06 19:42:37 84040 [Note] InnoDB: Using CPU crc32 instructions2019-05-06 19:42:37 84040 [Note] InnoDB: Initializing buffer pool, size = 128.0M2019-05-06 19:42:37 84040 [Note] InnoDB: Completed initialization of buffer pool2019-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 MB2019-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 MB2019-05-06 19:42:37 84040 [Note] InnoDB: Setting log file ./ib_logfile1 size to 48 MB2019-05-06 19:42:37 84040 [Note] InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile02019-05-06 19:42:37 84040 [Warning] InnoDB: New log files created, LSN=457812019-05-06 19:42:37 84040 [Note] InnoDB: Doublewrite buffer not found: creating new2019-05-06 19:42:37 84040 [Note] InnoDB: Doublewrite buffer created2019-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 created2019-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 start2019-05-06 19:42:37 84040 [Note] InnoDB: 5.6.43 started; log sequence number 02019-05-06 19:42:38 84040 [Note] Binlog end2019-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 1625977OKFilling 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 pages2019-05-06 19:42:40 84064 [Note] InnoDB: The InnoDB memory heap is disabled2019-05-06 19:42:40 84064 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins2019-05-06 19:42:40 84064 [Note] InnoDB: Memory barrier is not used2019-05-06 19:42:40 84064 [Note] InnoDB: Compressed tables use zlib 1.2.112019-05-06 19:42:40 84064 [Note] InnoDB: Using Linux native AIO2019-05-06 19:42:40 84064 [Note] InnoDB: Using CPU crc32 instructions2019-05-06 19:42:40 84064 [Note] InnoDB: Initializing buffer pool, size = 128.0M2019-05-06 19:42:40 84064 [Note] InnoDB: Completed initialization of buffer pool2019-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 start2019-05-06 19:42:40 84064 [Note] InnoDB: 5.6.43 started; log sequence number 16259772019-05-06 19:42:40 84064 [Note] Binlog end2019-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 1625987OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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_installationwhich will also give you the option of removing the testdatabases and anonymous user created by default.  This isstrongly 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.plPlease report any problems at http://bugs.mysql.com/The latest information about MySQL is available on the web at  http://www.mysql.comSupport MySQL by buying support/licenses at http://shop.mysql.comNew default config file was created as ./my.cnf andwill be used by default by the server when you start it.You may edit this file to change server settingsWARNING: Default config file /etc/my.cnf exists on the systemThis file will be read by default by the MySQL serverIf 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.cnfmariadb-libs-5.5.60-1.el7_5.x86_64[root@linux-001 mysql]# vim /etc/my.cnf[mysqld]datadir=/data/mysqlsocket=/tmp/mysql.sock# Disabling symbolic-links is recommended to prevent assorted security riskssymbolic-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 startStarting MySQL.Logging to '/data/mysql/linux-001.err'.. SUCCESS! [root@linux-001 mysql]# ps aux|grep mysqlroot84848  0.0  0.0  11816  1628 pts/0 S 19:530:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/data/mysql --pid-file=/data/mysql/linux-001.pidmysql  84986  7.0 24.1 1302736 449796 pts/0  Sl19:530: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.sockroot85029  0.0  0.0 112724984 pts/0 R 19:530: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]# !psps aux |grep mysqlroot85893  0.0  0.0 112724984 pts/1 R 20:010: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]# !psps aux |grep mysqlroot85529  0.0  0.0 113308  1640 pts/1 S 19:580: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  Sl19:580: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.sockroot85806  0.0  0.0 112724988 pts/1 R 20:000:00 grep --color=auto mysql[root@linux-001 mysql]# [root@linux-001 mysql]# netstat  -lntpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address  Foreign AddressState PID/Program name tcp  00 0.0.0.0:22  0.0.0.0:*LISTEN27416/sshd tcp  00 127.0.0.1:250.0.0.0:*LISTEN7003/mastertcp6 00 :::3306  :::*  LISTEN86158/mysqld  tcp6 00 :::22 :::*  LISTEN27416/sshd tcp6 00 ::1:25:::*  LISTEN7003/master[root@linux-001 mysql]# [root@linux-001 mysql]# killall mysqld [root@linux-001 mysql]# ps aux|grep mysqlroot85098  0.0  0.0 112724988 pts/0 R 19:540: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-wsrepmariadb-10.2.23-linux-glibc_214-x86_64/INSTALL-BINARYmariadb-10.2.23-linux-glibc_214-x86_64/EXCEPTIONS-CLIENTmariadb-10.2.23-linux-glibc_214-x86_64/COPYING.thirdpartymariadb-10.2.23-linux-glibc_214-x86_64/COPYINGmariadb-10.2.23-linux-glibc_214-x86_64/CREDITSmariadb-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/mariadbdatadir=/data/mariadbconf=/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/mariadbInstalling MariaDB/MySQL system tables in '/data/mariadb' ...OKTo start mysqld at boot time you have to copysupport-files/mysql.server to the right place for your systemPLEASE 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 testdatabases and anonymous user created by default.  This isstrongly recommended for production servers.See the MariaDB Knowledgebase at http://mariadb.com/kb or theMySQL 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.plcd './mysql-test' ; perl mysql-test-run.plPlease report any problems at http://mariadb.org/jiraThe latest information about MariaDB is available at http://mariadb.org/.You can find additional information about the MySQL part at:http://dev.mysql.comConsider 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 startReloading systemd:  [  确定  ]Starting mariadb (via systemctl):  [  确定  ][root@linux-001 mariadb]# ps aux |grep mysqlroot 8247  0.0  0.0 115436  1760 ?  S 06:530: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.pidmysql8359  3.2  3.1 1124476 58668 ? Sl06:530: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=3306root 8401  0.0  0.0 112724988 pts/0 R 06:530: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,89621.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,1501.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.utf8httpd-2.4.39/docs/manual/ssl/ssl_intro.html.enhttpd-2.4.39/docs/manual/ssl/ssl_compat.html.fr.utf8httpd-2.4.39/docs/manual/glossary.html.fr.utf8httpd-2.4.39/docs/manual/caching.htmlhttpd-2.4.39/docs/manual/custom-error.html.ja.utf8httpd-2.4.39/docs/manual/new_features_2_2.html.tr.utf8httpd-2.4.39/docs/manual/stopping.html.eshttpd-2.4.39/docs/manual/new_features_2_0.html.fr.utf8httpd-2.4.39/docs/manual/new_features_2_0.htmlhttpd-2.4.39/docs/manual/urlmapping.htmlhttpd-2.4.39/buildconfhttpd-2.4.39/Makefile.inhttpd-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.depapr-1.7.0/build/libtool.m4apr-1.7.0/build/preaprapp.dspapr-1.7.0/build/get-version.shapr-1.7.0/build/cvtdsp.plapr-1.7.0/build/buildcheck.shapr-1.7.0/build/libaprapp.depapr-1.7.0/build/ltmain.shapr-1.7.0/build/PrintPathapr-1.7.0/build/libaprapp.dspapr-1.7.0/apr.dswapr-1.7.0/libapr.dep[root@linux-01 src]# tar -zxvf apr-util-1.6.1.tar.gz……apr-util-1.6.1/dbm/NWGNUmakefileapr-util-1.6.1/dbm/apr_dbm_db.makapr-util-1.6.1/dbm/NWGNUdbmgdbmapr-util-1.6.1/dbm/apr_dbm.capr-util-1.6.1/dbm/apr_dbm_sdbm.capr-util-1.6.1/dbm/apr_dbm_db.dspapr-util-1.6.1/dbm/apr_dbm_db.depapr-util-1.6.1/dbm/apr_dbm_berkeleydb.capr-util-1.6.1/dbm/apr_dbm_gdbm.dspapr-util-1.6.1/dbm/NWGNUdbmdbapr-util-1.6.1/dbm/apr_dbm_gdbm.mak
4.3 安装apr
[root@linux-01 apr-1.7.0]# lsapr-config.in  apr.pc.in  build.conf  configure  encoding libapr.dsp  Makefile.innetwork_io  random  support  toolsapr.dep  apr.specbuild-outputs.mk  configure.in  file_io  libapr.mak  Makefile.win  NOTICEREADME  tablesuserapr.dsp  atomic  CHANGES  docs helpers  libapr.rcmemory  NWGNUmakefile  README.cmake  testapr.dsw  buildCMakeLists.txt dso  include  LICENSE  misc passwdshmemthreadprocapr.mak  buildconf  config.layout  emacs-mode libapr.dep  locks mmap poll  strings time[root@linux-01 apr-1.7.0]# ./configure  --prefix=/usr/local/aprchecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuConfiguring APR libraryPlatform: x86_64-pc-linux-gnuchecking for working mkdir -p... yesAPR Version: 1.7.0checking for chosen layout... aprchecking for gcc... nochecking for cc... nochecking for cl.exe... noconfigure: error: in `/usr/local/src/apr-1.7.0':configure: error: no acceptable C compiler found in $PATHSee `config.log' for more details

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

[root@linux-01 apr-1.7.0]# yum install -y gcc已加载插件:fastestmirror, langpacksDetermining fastest mirrors * base: mirrors.aliyun.com * extras: mirrors.163.com * updates: mirrors.aliyun.combase  | 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.2updates16 M为依赖而安装: cpp x86_64  4.8.5-36.el7_6.2updates  5.9 M glibc-devel  x86_64  2.17-260.el7_6.4updates  1.1 M glibc-headersx86_64  2.17-260.el7_6.4updates  683 k kernel-headers  x86_64  3.10.0-957.12.1.el7updates  8.0 M为依赖而更新: glibc  x86_64  2.17-260.el7_6.4updates  3.7 M glibc-common x86_64  2.17-260.el7_6.4updates12 M libgcc x86_64  4.8.5-36.el7_6.2updates  102 k libgompx86_64  4.8.5-36.el7_6.2updates  158 k事务概要==================================================================================================================================================安装  1 软件包 ( 4 依赖软件包)升级  ( 4 依赖软件包)总下载量:47 MDownloading 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 checkRunning transaction testTransaction test succeededRunning 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_643/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_646/13正在安装 : glibc-headers-2.17-260.el7_6.4.x86_64 7/13正在安装 : glibc-devel-2.17-260.el7_6.4.x86_648/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_6412/13清理  : libgcc-4.8.5-36.el7.x86_64  13/13验证中: glibc-2.17-260.el7_6.4.x86_641/13验证中: glibc-devel-2.17-260.el7_6.4.x86_642/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_649/13验证中: glibc-2.17-260.el7.x86_6410/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.4kernel-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.statusconfig.status: creating Makefileconfig.status: creating include/apr.hconfig.status: creating build/apr_rules.mkconfig.status: creating build/pkg/pkginfoconfig.status: creating apr-1-configconfig.status: creating apr.pcconfig.status: creating test/Makefileconfig.status: creating test/internal/Makefileconfig.status: creating include/arch/unix/apr_private.hconfig.status: executing libtool commandsrm: cannot remove 'libtoolT': No such file or directoryconfig.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.pcfor 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-1for 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-util4.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]# lsaprutil.dep  apu-config.in  CHANGESdbd includeLICENSE NWGNUmakefile strmatchaprutil.dsp  buckets  CMakeLists.txt  dbm ldapMakefile.inREADME  testaprutil.dsw  build config.layoutdocslibaprutil.dep  Makefile.win  README.cmake  uriaprutil.mak  buildconfconfigure encoding  libaprutil.dsp  memcacheREADME.FREETDSxlateapr-util.pc.in  build.conf  configure.in export_vars.sh.in  libaprutil.mak  misc redisxmlapr-util.specbuild-outputs.mk  crypto hooks  libaprutil.rcNOTICE  renames_pending[root@linux-01 apr-util-1.6.1]# ./configure  --with-apr=/usr/local/apr --prefix=/usr/local/apr-utilchecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for a BSD-compatible install... /usr/bin/install -cchecking for working mkdir -p... yesAPR-util Version: 1.6.1checking for chosen layout... apr-utilchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededApplying apr-util hints file rules for x86_64-pc-linux-gnuchecking 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 -Echecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for ldap support...checking for default DBM... sdbm (default)checking for pg_config... nochecking libpq-fe.h usability... nochecking libpq-fe.h presence... nochecking for libpq-fe.h... nochecking postgresql/libpq-fe.h usability... nochecking postgresql/libpq-fe.h presence... nochecking for postgresql/libpq-fe.h... nochecking sqlite3.h usability... nochecking sqlite3.h presence... nochecking for sqlite3.h... nochecking sqlite.h usability... nochecking sqlite.h presence... nochecking for sqlite.h... nochecking for odbc_config... nochecking sql.h usability... nochecking sql.h presence... nochecking for sql.h... nochecking odbc/sql.h usability... nochecking odbc/sql.h presence... nochecking for odbc/sql.h... nochecking Expat 1.95.x... nochecking old Debian-packaged expat... nochecking old FreeBSD-packaged expat... nochecking Expat 1.0/1.1... no  setting LDFLAGS to "-L/usr/local/lib"  adding "-I/usr/local/include" to CPPFLAGSchecking 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... yeschecking iconv.h presence... yeschecking for iconv.h... yeschecking for type of inbuf parameter to iconv... char **checking for iconv.h... (cached) yeschecking langinfo.h usability... yeschecking langinfo.h presence... yeschecking for langinfo.h... yeschecking for nl_langinfo... yeschecking for CODESET in langinfo.h... yeschecking whether APR has DSO support... yeschecking for library containing crypt... -lcryptchecking if system crypt() function is threadsafe... nochecking for crypt_r... yeschecking style of crypt_r... struct_crypt_datachecking whether the compiler handles weak symbols... yeschecking for memset_s support... nochecking for explicit_bzero support... no  setting APRUTIL_LIBS to " /usr/local/apr/lib/libapr-1.la -lrt -lcrypt  -lpthread -ldl"configure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating export_vars.shconfig.status: creating build/pkg/pkginfoconfig.status: creating apr-util.pcconfig.status: creating apu-1-configconfig.status: creating include/private/apu_select_dbm.hconfig.status: creating include/apr_ldap.hconfig.status: creating include/apu.hconfig.status: creating include/apu_want.hconfig.status: creating test/Makefileconfig.status: creating include/private/apu_config.hconfig.status: include/private/apu_config.h is unchangedconfig.status: executing default commands[root@linux-01 apr-util-1.6.1]# echo $?0[root@linux-01 apr-util-1.6.1]# make && make installmake[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.loxml/apr_xml.c:35:19: 致命错误:expat.h:没有那个文件或目录 #include <expat.h> ^编译中断。make[1]: *** [xml/apr_xml.lo] 错误 1make[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, langpacksLoading 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  base57 k事务概要==================================================================================================================================================安装  1 软件包总下载量:57 k安装大小:178 kDownloading packages:expat-devel-2.1.0-10.el7_3.x86_64.rpm  |  57 kB  00:00:00  Running transaction checkRunning transaction testTransaction test succeededRunning transaction  正在安装 : expat-devel-2.1.0-10.el7_3.x86_641/1验证中: expat-devel-2.1.0-10.el7_3.x86_641/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-utilchecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuchecking for a BSD-compatible install... /usr/bin/install -cchecking for working mkdir -p... yesAPR-util Version: 1.6.1checking for chosen layout... apr-utilchecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededApplying apr-util hints file rules for x86_64-pc-linux-gnuchecking 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 -Echecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking for ldap support...checking for default DBM... sdbm (default)checking for pg_config... nochecking libpq-fe.h usability... nochecking libpq-fe.h presence... nochecking for libpq-fe.h... nochecking postgresql/libpq-fe.h usability... nochecking postgresql/libpq-fe.h presence... nochecking for postgresql/libpq-fe.h... nochecking sqlite3.h usability... nochecking sqlite3.h presence... nochecking for sqlite3.h... nochecking sqlite.h usability... nochecking sqlite.h presence... nochecking for sqlite.h... nochecking for odbc_config... nochecking sql.h usability... nochecking sql.h presence... nochecking for sql.h... nochecking odbc/sql.h usability... nochecking odbc/sql.h presence... nochecking for odbc/sql.h... nochecking Expat 1.95.x... yes  setting APRUTIL_EXPORT_LIBS to "-lexpat"  setting APRUTIL_LIBS to "-lexpat"checking iconv.h usability... yeschecking iconv.h presence... yeschecking for iconv.h... yeschecking for type of inbuf parameter to iconv... char **checking for iconv.h... (cached) yeschecking langinfo.h usability... yeschecking langinfo.h presence... yeschecking for langinfo.h... yeschecking for nl_langinfo... yeschecking for CODESET in langinfo.h... yeschecking whether APR has DSO support... yeschecking for library containing crypt... -lcryptchecking if system crypt() function is threadsafe... nochecking for crypt_r... yeschecking style of crypt_r... struct_crypt_datachecking whether the compiler handles weak symbols... yeschecking for memset_s support... nochecking 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_LIBSconfigure: creating ./config.statusconfig.status: creating Makefileconfig.status: creating export_vars.shconfig.status: creating build/pkg/pkginfoconfig.status: creating apr-util.pcconfig.status: creating apu-1-configconfig.status: creating include/private/apu_select_dbm.hconfig.status: creating include/apr_ldap.hconfig.status: creating include/apu.hconfig.status: creating include/apu_want.hconfig.status: creating test/Makefileconfig.status: creating include/private/apu_config.hconfig.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 installmake[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 -ldlgawk -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.cgawk -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.cgcc -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.expgcc -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.expsed 's,^\(location=\).*$,\1installed,' < apu-1-config > apu-config.outmake[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/binfor 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.pclist=''; 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/liblibtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.so.0.6.1 /usr/local/apr-util/lib/libaprutil-1.so.0.6.1libtool: 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.lalibtool: install: /usr/bin/install -c -m 755 .libs/libaprutil-1.a /usr/local/apr-util/lib/libaprutil-1.alibtool: install: chmod 644 /usr/local/apr-util/lib/libaprutil-1.alibtool: install: ranlib /usr/local/apr-util/lib/libaprutil-1.alibtool: 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/libIf you ever happen to want to link against installed librariesin a given directory, LIBDIR, you must either use libtool, andspecify 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 formore 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 安装httpd4.5.1 编译安装httpd
[root@linux-01 apr-util-1.6.1]# cd ../httpd-2.4.39/[root@linux-01 httpd-2.4.39]# lsABOUT_APACHE  ap.d CHANGESdocshttpd.speclibhttpd.dep  Makefile.winREADMEsrclibacinclude.m4  buildCMakeLists.txt  emacs-style  includelibhttpd.dsp  modules  README.cmakesupportApache-apr2.dsw  BuildAll.dsp  config.layouthttpd.dep INSTALLlibhttpd.mak  NOTICEREADME.platforms  testApache.dsw BuildBin.dsp  configure httpd.dsp InstallBin.dsp  LICENSE NWGNUmakefile  ROADMAP  VERSIONINGapache_probes.d  buildconf  configure.in httpd.mak LAYOUT Makefile.inos 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=mostchecking for chosen layout... Apachechecking for working mkdir -p... yeschecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuconfigure: 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... yeschecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking how to run the C preprocessor... gcc -Echecking for gcc option to accept ISO C99... -std=gnu99checking for pcre-config... falseconfigure: 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, langpacksLoading 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-develx86_648.32-17.el7base480 k事务概要==================================================================================================================================================安装  1 软件包总下载量:480 k安装大小:1.4 MDownloading packages:pcre-devel-8.32-17.el7.x86_64.rpm| 480 kB  00:00:00  Running transaction checkRunning transaction testTransaction test succeededRunning 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=mostchecking for chosen layout... Apachechecking for working mkdir -p... yeschecking for grep that handles long lines and -e... /usr/bin/grepchecking for egrep... /usr/bin/grep -Echecking build system type... x86_64-pc-linux-gnuchecking host system type... x86_64-pc-linux-gnuchecking target system type... x86_64-pc-linux-gnuconfigure: 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... yeschecking for gcc... gccchecking whether the C compiler works... yeschecking for C compiler default output file name... a.outchecking for suffix of executables... checking whether we are cross compiling... nochecking for suffix of object files... ochecking whether we are using the GNU C compiler... yeschecking whether gcc accepts -g... yeschecking for gcc option to accept ISO C89... none neededchecking how to run the C preprocessor... gcc -Echecking for gcc option to accept ISO C99... -std=gnu99checking for pcre-config... /usr/bin/pcre-configconfigure: 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 INCLUDESconfigure: 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/rmchecking for pkg-config... /usr/bin/pkg-configchecking for rsync... /usr/bin/rsyncchecking for gawk... gawkchecking whether ln -s works... yeschecking for ranlib... ranlibchecking for lynx... nochecking for links... nochecking for elinks... nochecking for ANSI C header files... yeschecking for sys/types.h... yeschecking for sys/stat.h... yeschecking for stdlib.h... yeschecking for string.h... yeschecking for memory.h... yeschecking for strings.h... yeschecking for inttypes.h... yeschecking for stdint.h... yeschecking for unistd.h... yeschecking minix/config.h usability... nochecking minix/config.h presence... nochecking for minix/config.h... nochecking whether it is safe to define __EXTENSIONS__... yeschecking for library containing strerror... none requiredchecking for APR version 1.3.0 or later... yeschecking for APR-util version 1.3.0 or later... yeschecking for ANSI C header files... (cached) yeschecking for string.h... (cached) yeschecking limits.h usability... yeschecking limits.h presence... yeschecking for limits.h... yeschecking for unistd.h... (cached) yeschecking sys/socket.h usability... yeschecking sys/socket.h presence... yeschecking for sys/socket.h... yeschecking pwd.h usability... yeschecking pwd.h presence... yeschecking for pwd.h... yeschecking grp.h usability... yeschecking grp.h presence... yeschecking for grp.h... yeschecking for strings.h... (cached) yeschecking sys/prctl.h usability... yeschecking sys/prctl.h presence... yeschecking for sys/prctl.h... yeschecking sys/processor.h usability... nochecking sys/processor.h presence... nochecking for sys/processor.h... nochecking sys/sem.h usability... yeschecking sys/sem.h presence... yeschecking for sys/sem.h... yeschecking sys/sdt.h usability... nochecking sys/sdt.h presence... nochecking for sys/sdt.h... nochecking sys/loadavg.h usability... nochecking sys/loadavg.h presence... nochecking for sys/loadavg.h... nochecking for sys/wait.h that is POSIX.1 compatible... yeschecking for an ANSI C-conforming const... yeschecking for library containing sqrt... -lmchecking for library containing crypt... -lcryptchecking for getpwnam... yeschecking for getgrnam... yeschecking for initgroups... yeschecking for bindprocessor... nochecking for prctl... yeschecking for timegm... yeschecking for getpgid... yeschecking for fopen64... yeschecking for getloadavg... yeschecking for void pointer length... nochecking for gettid()... yeschecking for tm_gmtoff in struct tm... yeschecking whether to enable mod_authn_file... sharedchecking 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... sharedchecking whether to enable mod_authz_host... sharedchecking whether to enable mod_authz_groupfile... sharedchecking whether to enable mod_authz_user... sharedchecking 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... sharedchecking whether to enable mod_authnz_ldap... checking dependencieschecking for ldap support in apr/apr-util... noconfigure: WARNING: apr/apr-util is compiled without ldap supportchecking whether to enable mod_authnz_ldap... no (disabled)checking whether to enable mod_authnz_fcgi... nochecking whether to enable mod_access_compat... sharedchecking whether to enable mod_auth_basic... sharedchecking whether to enable mod_auth_form... shared (most)checking whether to enable mod_auth_digest... checking dependencieschecking whether to enable mod_auth_digest... shared (most)checking whether to enable mod_allowmethods... shared (most)  adding "-I$(top_srcdir)/modules/aaa" to INCLUDESchecking whether to enable mod_isapi... nochecking whether to enable mod_file_cache... shared (most)checking whether to enable mod_cache... shared (most)checking whether to enable mod_cache_disk... checking dependencieschecking 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 dependencieschecking whether to enable mod_watchdog... shared (most)checking whether to enable mod_macro... shared (most)  adding "-I$(top_srcdir)/modules/core" to INCLUDESchecking whether to enable mod_dbd... shared (most)  adding "-I$(top_srcdir)/modules/database" to INCLUDESchecking whether to enable mod_bucketeer... nochecking whether to enable mod_dumpio... shared (most)checking whether to enable mod_echo... nochecking whether to enable mod_example_hooks... nochecking whether to enable mod_case_filter... nochecking whether to enable mod_case_filter_in... nochecking whether to enable mod_example_ipc... nochecking whether to enable mod_buffer... shared (most)checking whether to enable mod_data... nochecking whether to enable mod_ratelimit... shared (most)checking whether to enable mod_reqtimeout... sharedchecking 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... sharedchecking whether to enable mod_reflector... nochecking 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... nochecking whether to enable mod_deflate... checking dependencieschecking for zlib location... not foundchecking whether to enable mod_deflate... no (disabled)checking whether to enable mod_xml2enc... nochecking whether to enable mod_proxy_html... nochecking whether to enable mod_brotli... checking dependencieschecking for Brotli library >= 0.6.0 via pkg-config... nochecking whether to enable mod_brotli... no (disabled)  adding "-I$(top_srcdir)/modules/filters" to INCLUDESchecking whether to enable mod_http... static  adding "$(MOD_HTTP_LDADD)" to AP_LIBSchecking whether to enable mod_mime... sharedchecking whether to enable mod_ldap... checking dependencieschecking for ldap support in apr/apr-util... (cached) noconfigure: WARNING: apr/apr-util is compiled without ldap supportchecking whether to enable mod_ldap... no (disabled)  adding "-I$(top_srcdir)/modules/ldap" to INCLUDESchecking whether to enable mod_log_config... sharedchecking whether to enable mod_log_debug... shared (most)checking whether to enable mod_log_forensic... nochecking whether to enable mod_logio... shared (most)  adding "-I$(top_srcdir)/modules/loggers" to INCLUDESchecking whether to enable mod_lua... no  adding "-I$(top_srcdir)/modules/lua" to INCLUDESchecking whether to enable mod_env... sharedchecking whether to enable mod_mime_magic... nochecking whether to enable mod_cern_meta... nochecking whether to enable mod_expires... shared (most)checking whether to enable mod_headers... sharedchecking whether to enable mod_ident... nochecking whether to enable mod_usertrack... nochecking whether to enable mod_unique_id... shared (most)checking whether to enable mod_setenvif... sharedchecking whether to enable mod_version... sharedchecking whether to enable mod_remoteip... shared (most)checking whether to enable mod_proxy... shared (most)checking whether to enable mod_proxy_connect... checking dependencieschecking whether to enable mod_proxy_connect... shared (most)checking whether to enable mod_proxy_ftp... checking dependencieschecking whether to enable mod_proxy_ftp... shared (most)checking whether to enable mod_proxy_http... checking dependencieschecking whether to enable mod_proxy_http... shared (most)checking whether to enable mod_proxy_fcgi... checking dependencieschecking whether to enable mod_proxy_fcgi... shared (most)checking whether to enable mod_proxy_scgi... checking dependencieschecking whether to enable mod_proxy_scgi... shared (most)checking whether to enable mod_proxy_uwsgi... checking dependencieschecking whether to enable mod_proxy_uwsgi... shared (most)checking whether to enable mod_proxy_fdpass... checking dependencieschecking whether CMSG_DATA is declared... yeschecking whether to enable mod_proxy_fdpass... shared (most)checking whether to enable mod_proxy_wstunnel... checking dependencieschecking whether to enable mod_proxy_wstunnel... shared (most)checking whether to enable mod_proxy_ajp... checking dependencieschecking whether to enable mod_proxy_ajp... shared (most)checking whether to enable mod_proxy_balancer... checking dependencieschecking whether to enable mod_proxy_balancer... shared (most)checking whether to enable mod_proxy_express... checking dependencieschecking whether to enable mod_proxy_express... shared (most)checking whether to enable mod_proxy_hcheck... checking dependencieschecking whether to enable mod_proxy_hcheck... shared (most)  adding "-I$(top_srcdir)/modules/proxy" to INCLUDES  adding "-I$(top_srcdir)/modules/http2" to INCLUDESchecking whether to enable mod_session... shared (most)checking whether to enable mod_session_cookie... checking dependencieschecking whether to enable mod_session_cookie... shared (most)configure: WARNING: Your APR does not include SSL/EVP support. To enable it: configure --with-cryptochecking whether to enable mod_session_crypto... nochecking whether to enable mod_session_dbd... checking dependencieschecking whether to enable mod_session_dbd... shared (most)  adding "-I$(top_srcdir)/modules/session" to INCLUDESchecking whether to enable mod_slotmem_shm... shared (most)checking whether to enable mod_slotmem_plain... nochecking whether to enable mod_ssl... checking dependencieschecking for OpenSSL... checking for user-provided OpenSSL base directory... nonechecking for OpenSSL version >= 0.9.8a... FAILEDconfigure: WARNING: OpenSSL version is too oldnochecking whether to enable mod_ssl... no (disabled)  adding "-I$(top_srcdir)/modules/ssl" to INCLUDESchecking whether to enable mod_optional_hook_export... nochecking whether to enable mod_optional_hook_import... nochecking whether to enable mod_optional_fn_import... nochecking whether to enable mod_optional_fn_export... nochecking whether to enable mod_dialup... no  adding "-I$(top_srcdir)/modules/test" to INCLUDESchecking for target platform... unixchecking for rlim_t... yeschecking sys/time.h usability... yeschecking sys/time.h presence... yeschecking for sys/time.h... yeschecking sys/resource.h usability... yeschecking sys/resource.h presence... yeschecking for sys/resource.h... yeschecking for sys/sem.h... (cached) yeschecking sys/ipc.h usability... yeschecking sys/ipc.h presence... yeschecking for sys/ipc.h... yeschecking for setsid... yeschecking for killpg... yeschecking bstring.h usability... nochecking bstring.h presence... nochecking for bstring.h... nochecking for unistd.h... (cached) yeschecking for syslog... yeschecking sys/times.h usability... yeschecking sys/times.h presence... yeschecking for sys/times.h... yeschecking for times... yes  adding "-I$(top_srcdir)/server" to INCLUDESchecking whether APR supports thread-safe pollsets... checking for kqueue... nochecking for port_create... nochecking for epoll_create... yesyeschecking if event MPM supports this platform... yeschecking if mpmt_os2 MPM supports this platform... nochecking if prefork MPM supports this platform... yeschecking if WinNT MPM supports this platform... nochecking if worker MPM supports this platform... yeschecking whether to enable mod_http2... checking dependencieschecking for OpenSSL... (cached) nochecking for nghttp2... checking for user-provided nghttp2 base directory... nonechecking for pkg-config along ... checking for nghttp2 version >= 1.2.1... FAILEDconfigure: WARNING: nghttp2 version is too oldnochecking whether to enable mod_http2... no (disabled)checking whether to enable mod_proxy_http2... no  adding "-I$(top_srcdir)/modules/md" to INCLUDESchecking whether to enable mod_md... checking dependencieschecking for OpenSSL... (cached) noconfigure: WARNING: libssl (or compatible) not foundchecking for jansson... checking for user-provided jansson base directory... nonechecking for pkg-config along ... FAILEDnoconfigure: WARNING: libjansson not foundchecking for curl... checking for user-provided curl base directory... nonechecking for pkg-config along ... checking curl/curl.h usability... nochecking curl/curl.h presence... nochecking for curl/curl.h... nochecking for curl version >= 7.50... FAILEDnoconfigure: WARNING: libcurl not foundchecking for arc4random_buf... nochecking whether to enable mod_md... no (disabled)checking whether to enable mod_lbmethod_byrequests... checking dependencieschecking whether to enable mod_lbmethod_byrequests... sharedchecking whether to enable mod_lbmethod_bytraffic... checking dependencieschecking whether to enable mod_lbmethod_bytraffic... sharedchecking whether to enable mod_lbmethod_bybusyness... checking dependencieschecking whether to enable mod_lbmethod_bybusyness... sharedchecking whether to enable mod_lbmethod_heartbeat... checking dependencieschecking whether to enable mod_lbmethod_heartbeat... sharedchecking which MPM to use by default... event  adding "$(MOD_MPM_EVENT_LDADD)" to AP_LIBSchecking for pthread_kill... yeschecking whether to enable mod_unixd... sharedchecking whether to enable mod_privileges... no  adding "-I$(top_srcdir)/modules/arch/unix" to INCLUDESchecking whether to enable mod_heartbeat... nochecking whether to enable mod_heartmonitor... nochecking whether to enable mod_dav... shared (most)  adding "-I$(top_srcdir)/modules/dav/main" to INCLUDESchecking whether to enable mod_status... sharedchecking whether to enable mod_autoindex... sharedchecking whether to enable mod_asis... nochecking whether to enable mod_info... shared (most)checking whether to enable mod_suexec... nochecking whether to enable mod_cgid... checking dependencieschecking whether to enable mod_cgid... shared (most)checking whether to enable mod_cgi... no  adding "-I$(top_srcdir)/modules/generators" to INCLUDESchecking whether to enable mod_dav_fs... checking dependencieschecking whether to enable mod_dav_fs... sharedchecking whether to enable mod_dav_lock... nochecking for extra modules... nonechecking whether to enable mod_vhost_alias... shared (most)checking whether to enable mod_negotiation... shared (most)checking whether to enable mod_dir... sharedchecking whether to enable mod_imagemap... nochecking 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... sharedchecking whether to enable mod_rewrite... shared (most)  adding "-I$(top_srcdir)/modules/mappers" to INCLUDESconfigure: 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.mkconfigure: creating ./config.statuscreating modules/aaa/Makefilecreating modules/arch/win32/Makefilecreating modules/cache/Makefilecreating modules/core/Makefilecreating modules/database/Makefilecreating modules/debugging/Makefilecreating modules/echo/Makefilecreating modules/examples/Makefilecreating modules/experimental/Makefilecreating modules/filters/Makefilecreating modules/http/Makefilecreating modules/ldap/Makefilecreating modules/loggers/Makefilecreating modules/lua/Makefilecreating modules/metadata/Makefilecreating modules/proxy/Makefilecreating modules/session/Makefilecreating modules/slotmem/Makefilecreating modules/ssl/Makefilecreating modules/test/Makefilecreating os/unix/Makefilecreating modules/http2/Makefilecreating modules/md/Makefilecreating modules/proxy/balancers/Makefilecreating server/mpm/Makefilecreating server/mpm/event/Makefilecreating modules/arch/unix/Makefilecreating modules/cluster/Makefilecreating modules/dav/main/Makefilecreating modules/generators/Makefilecreating modules/dav/fs/Makefilecreating modules/dav/lock/Makefilecreating modules/mappers/Makefilecreating Makefilecreating modules/Makefilecreating srclib/Makefilecreating os/Makefilecreating server/Makefilecreating support/Makefilecreating test/Makefileconfig.status: creating docs/conf/httpd.confconfig.status: creating docs/conf/extra/httpd-autoindex.confconfig.status: creating docs/conf/extra/httpd-dav.confconfig.status: creating docs/conf/extra/httpd-default.confconfig.status: creating docs/conf/extra/httpd-info.confconfig.status: creating docs/conf/extra/httpd-languages.confconfig.status: creating docs/conf/extra/httpd-manual.confconfig.status: creating docs/conf/extra/httpd-mpm.confconfig.status: creating docs/conf/extra/httpd-multilang-errordoc.confconfig.status: creating docs/conf/extra/httpd-ssl.confconfig.status: creating docs/conf/extra/httpd-userdir.confconfig.status: creating docs/conf/extra/httpd-vhosts.confconfig.status: creating docs/conf/extra/proxy-html.confconfig.status: creating include/ap_config_layout.hconfig.status: creating support/apxsconfig.status: creating support/apachectlconfig.status: creating support/dbmmanageconfig.status: creating support/envvars-stdconfig.status: creating support/log_server_statusconfig.status: creating support/logresolve.plconfig.status: creating support/phf_abuse_log.cgiconfig.status: creating support/split-logfileconfig.status: creating build/rules.mkconfig.status: creating build/pkg/pkginfoconfig.status: creating build/config_vars.shconfig.status: creating include/ap_config_auto.hconfig.status: executing default commandsconfigure: summary of build options: Server Version: 2.4.39 Install prefix: /usr/local/httpd2.4 C compiler:  gcc -std=gnu99 CFLAGS: -g -O2 -pthreadCPPFLAGS:  -DLINUX -D_REENTRANT -D_GNU_SOURCELDFLAGS: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  startAH00558: 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 httproot56461  0.0  0.1  97760  2588 ?  Ss01:510:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 56462  0.0  0.2 386672  4424 ?  Sl01:510:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 56463  0.0  0.2 386672  4424 ?  Sl01:510:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 56464  0.0  0.2 386672  4420 ?  Sl01:510:00 /usr/local/httpd2.4/bin/httpd -k startroot56547  0.0  0.0 112728988 pts/0 S 01:510:00 grep --color=auto http[root@linux-01 httpd-2.4.39]# netstat  -ltnpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address  Foreign AddressState PID/Program name tcp  00 0.0.0.0:111 0.0.0.0:*LISTEN1/systemd  tcp  00 192.168.122.1:53  0.0.0.0:*LISTEN7229/dnsmasq  tcp  00 0.0.0.0:22  0.0.0.0:*LISTEN6850/sshd  tcp  00 127.0.0.1:631  0.0.0.0:*LISTEN6847/cupsd tcp  00 127.0.0.1:250.0.0.0:*LISTEN7219/mastertcp  00 127.0.0.1:6010 0.0.0.0:*LISTEN7534/sshd: root@pts tcp6 00 :::111:::*  LISTEN1/systemd  tcp6 00 :::80 :::*  LISTEN56461/httpdtcp6 00 :::22 :::*  LISTEN6850/sshd  tcp6 00 ::1:631  :::*  LISTEN6847/cupsd tcp6 00 ::1:25:::*  LISTEN7219/mastertcp6 00 ::1:6010 :::*  LISTEN7534/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 -MAH00558: 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 messageLoaded 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.7s2019-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,476381KB/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/NEWSphp-5.6.39/server-tests.phpphp-5.6.39/php.ini-developmentphp-5.6.39/EXTENSIONSphp-5.6.39/README.namespacesphp-5.6.39/pear/php-5.6.39/pear/install-pear.txtphp-5.6.39/pear/install-pear-nozlib.pharphp-5.6.39/pear/fetch.phpphp-5.6.39/pear/Makefile.fragphp-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]# lsacinclude.m4generated_lists  mkinstalldirs README.NEW-OUTPUT-API server-tests-config.phpaclocal.m4  genfilesnetware README.PARAMETER_PARSING_APIserver-tests.phpbuild header  NEWS README.REDIST.BINS snapshotbuildconfINSTALL pear README.RELEASE_PROCESSstamp-h.inbuildconf.bat  install-sh php5.spec.in  README.SELF-CONTAINED-EXTENSIONS  stub.cCODING_STANDARDS  LICENSE php.gif README.STREAMS  testsconfig.guessltmain.sh  php.ini-development README.SUBMITTING_PATCH  travisconfig.sub  main php.ini-production  README.TESTING  TSRMconfiguremakedistREADME.EXT_SKEL  README.TESTING2 UPGRADINGconfigure.inMakefile.frag README.GIT-RULES README.UNIX-BUILD-SYSTEM UPGRADING.INTERNALSCREDITS  Makefile.gcov README.input_filter README.WIN32-BUILD-SYSTEMvcscleanextMakefile.global  README.MAILINGLIST_RULES  run-tests.phpwin32EXTENSIONS  makerpm README.md  sapiZendfootermissing README.namespacesscripts[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-exifConfiguring extensionschecking size of long... (cached) 8checking size of int... (cached) 4checking for int32_t... yeschecking for uint32_t... yeschecking for sys/types.h... (cached) yeschecking for inttypes.h... (cached) yeschecking for stdint.h... (cached) yeschecking for string.h... (cached) yeschecking for stdlib.h... (cached) yeschecking for strtoll... yeschecking for atoll... yeschecking for strftime... (cached) yeschecking which regex library to use... phpchecking whether to enable LIBXML support... yeschecking libxml2 install dir... yeschecking 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 已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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-develx86_64 5.2.2-1.el7  base  46 k事务概要=====================================================================================================================================安装  1 软件包 ( 1 依赖软件包)总下载量:1.1 M安装大小:8.9 MDownloading 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 checkRunning transaction testTransaction test succeededRunning 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 extensionschecking size of long... (cached) 8checking size of int... (cached) 4checking for int32_t... yeschecking for uint32_t... yeschecking for sys/types.h... (cached) yeschecking for inttypes.h... (cached) yeschecking for stdint.h... (cached) yeschecking for string.h... (cached) yeschecking for stdlib.h... (cached) yeschecking for strtoll... yeschecking for atoll... yeschecking for strftime... (cached) yeschecking which regex library to use... phpchecking whether to enable LIBXML support... yeschecking libxml2 install dir... yeschecking for xml2-config path... /usr/bin/xml2-configchecking whether libxml build works... yeschecking for OpenSSL support... yeschecking for Kerberos support... nochecking whether to use system default cipher list instead of hardcoded value... nochecking for DSA_get_default_method in -lssl... nochecking for X509_free in -lcrypto... nochecking for RAND_egd... nochecking for pkg-config... /usr/bin/pkg-configconfigure: error: Cannot find OpenSSL's <evp.h>
5.5 上文的报错提示缺少openssl
[root@linux-001 php-5.6.39]# yum install  -y openssl-devel已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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-develx86_641:1.0.2k-16.el7_6.1updates1.5 M为依赖而安装: keyutils-libs-develx86_641.5.8-3.el7  base 37 k krb5-develx86_641.15.1-37.el7_6 updates271 k libcom_err-develx86_641.42.9-13.el7base 31 k libkadm5  x86_641.15.1-37.el7_6 updates178 k libselinux-develx86_642.5-14.1.el7 base187 k libsepol-devel  x86_642.5-10.el7base 77 k libverto-devel  x86_640.2.5-4.el7  base 12 k为依赖而更新: krb5-libs x86_641.15.1-37.el7_6 updates803 k opensslx86_641:1.0.2k-16.el7_6.1updates493 k openssl-libs x86_641:1.0.2k-16.el7_6.1updates1.2 M事务概要=====================================================================================================================================安装  1 软件包 ( 7 依赖软件包)升级  ( 3 依赖软件包)总下载量:4.7 MDownloading 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 checkRunning transaction testTransaction test succeededRunning 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_643/14正在安装 : libcom_err-devel-1.42.9-13.el7.x86_644/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_6412/14清理  : krb5-libs-1.15.1-34.el7.x86_6413/14清理  : 1:openssl-libs-1.0.2k-16.el7.x86_64 14/14验证中: 1:openssl-1.0.2k-16.el7_6.1.x86_641/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_645/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_6413/14验证中: 1:openssl-1.0.2k-16.el7.x86_6414/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.el7libkadm5.x86_64 0:1.15.1-37.el7_6libselinux-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.7checking for gzgets in -lz... yeschecking whether to enable bc style precision math functions... nochecking for BZip2 support... yeschecking for BZip2 in default path... not foundconfigure: error: Please reinstall the BZip2 distribution
5.6 上文的报错提示缺少bzip2
[root@linux-001 php-5.6.39]# yum install -y bzip2-devel已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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.el7base  218 k事务概要=====================================================================================================================================安装  1 软件包总下载量:218 k安装大小:382 kDownloading packages:bzip2-devel-1.0.6-13.el7.x86_64.rpm| 218 kB  00:00:00  Running transaction checkRunning transaction testTransaction test succeededRunning 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... nochecking whether to enable truetype string function in GD... yeschecking whether to enable JIS-mapped Japanese font support in GD... noIf 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已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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-develx86_641.2.90-6.el7 base 99 k为依赖而安装: libjpeg-turbox86_641.2.90-6.el7 base134 k事务概要=====================================================================================================================================安装  1 软件包 ( 1 依赖软件包)总下载量:233 k安装大小:657 kDownloading 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 checkRunning transaction testTransaction test succeededRunning 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... nochecking whether to enable truetype string function in GD... yeschecking whether to enable JIS-mapped Japanese font support in GD... noIf configure fails try --with-vpx-dir=<DIR>checking for jpeg_read_header in -ljpeg... yesconfigure: 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已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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 kDownloading packages:libpng-devel-1.5.13-7.el7_2.x86_64.rpm| 122 kB  00:00:05  Running transaction checkRunning transaction testTransaction test succeededRunning 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... yeschecking for png_write_image in -lpng... yesIf 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已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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-develx86_642.8-12.el7_6.1 updates447 k为依赖而更新: freetypex86_642.8-12.el7_6.1 updates380 k事务概要=====================================================================================================================================安装  1 软件包升级  ( 1 依赖软件包)总下载量:826 kDownloading 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 checkRunning transaction testTransaction test succeededRunning 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_643/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_643/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) yeschecking for alloca... (cached) yeschecking for working memcmp... yeschecking for stdarg.h... (cached) yeschecking for mcrypt support... yesconfigure: error: mcrypt.h not found. Please reinstall libmcrypt.
5.10 上文的报错提示缺少libmcrypt
[root@linux-001 php-5.6.39]# yum install -y  libmcrypt-devel已加载插件:fastestmirrorRepository base is listed more than once in the configurationRepository updates is listed more than once in the configurationRepository extras is listed more than once in the configurationRepository centosplus is listed more than once in the configurationLoading 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 kDownloading 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. FAILEDhttp://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 checkRunning transaction testTransaction test succeededRunning transaction  正在安装 : libmcrypt-2.5.8-13.el7.x86_641/2正在安装 : libmcrypt-devel-2.5.8-13.el7.x86_642/2验证中: libmcrypt-devel-2.5.8-13.el7.x86_641/2验证中: libmcrypt-2.5.8-13.el7.x86_642/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.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php-configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/cgi/php-cgi.1config.status: creating ext/phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commands[root@linux-001 php-5.6.39]# make && make installInstalling 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.solibtool: install: install .libs/libphp5.lai /usr/local/httpd2.4/modules/libphp5.lalibtool: 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-configInstalling man pages: /usr/local/php/php/man/man1/  page: phpize.1  page: php-config.1Installing 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.5Wrote PEAR system config file at: /usr/local/php/etc/pear.confYou 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/binln -s -f phar.phar /usr/local/php/bin/pharInstalling 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]bz2CorectypedatedomeregexiffileinfofiltergdhashiconvjsonlibxmlmbstringmcryptmysqlmysqliopensslpcrePDOpdo_mysqlpdo_sqlitePharposixReflectionsessionSimpleXMLsoapsocketsSPLsqlite3standardtokenizerxmlxmlreaderxmlwriterzlib[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 | lessPHP 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 0phpinfo()PHP Version => 5.6.39System => Linux linux-001 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64Build Date => May  8 2019 00:15:24Configure 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 InterfaceVirtual Directory Support => enabledConfiguration File (php.ini) Path => /usr/local/php/etcLoaded Configuration File => /usr/local/php/etc/php.ini//此处已经加载了配置文件Scan this dir for additional .ini files => (none)Additional .ini files parsed => (none)PHP API => 20131106PHP Extension => 20131226Zend Extension => 220131226Zend Extension Build => API220131226,TSPHP Extension Build => API20131226,TSDebug Build => noThread Safety => enabledZend Signal Handling => disabledZend Memory Manager => enabledZend Multibyte Support => provided by mbstringIPv6 Support => enabled:
6 安装php76.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,886467KB/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.hphp-7.3.0/Zend/zend_extensions.hphp-7.3.0/Zend/zend_vm_trace_map.hphp-7.3.0/Zend/zend_alloc.cphp-7.3.0/Zend/zend_builtin_functions.hphp-7.3.0/Zend/zend_ini_parser.cphp-7.3.0/Zend/zend_errors.hphp-7.3.0/Zend/zend_smart_str.hphp-7.3.0/Zend/zend_generators.hphp-7.3.0/Zend/zend_ptr_stack.hphp-7.3.0/Zend/zend_stream.cphp-7.3.0/Zend/zend_build.hphp-7.3.0/Zend/acinclude.m4php-7.3.0/Zend/zend_vm_trace_handlers.hphp-7.3.0/Zend/zend_objects_API.hphp-7.3.0/Zend/zend_ini_parser.outputphp-7.3.0/Zend/zend_ini_scanner.cphp-7.3.0/Zend/zend_float.hphp-7.3.0/Zend/zend_alloc.hphp-7.3.0/acinclude.m4php-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.specconfig.status: creating main/build-defs.hconfig.status: creating scripts/phpizeconfig.status: creating scripts/man1/phpize.1config.status: creating scripts/php-configconfig.status: creating scripts/man1/php-config.1config.status: creating sapi/cli/php.1config.status: creating sapi/phpdbg/phpdbg.1config.status: creating sapi/cgi/php-cgi.1config.status: creating ext/phar/phar.1config.status: creating ext/phar/phar.phar.1config.status: creating main/php_config.hconfig.status: executing default commandsconfigure: 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.solibtool: install: install .libs/libphp7.lai /usr/local/httpd2.4/modules/libphp7.lalibtool: 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-configInstalling man pages: /usr/local/php7/php/man/man1/  page: phpize.1  page: php-config.1Installing 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.5Wrote PEAR system config file at: /usr/local/php7/etc/pear.confYou 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/binln -s -f phar.phar /usr/local/php7/bin/pharInstalling 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]bz2CorectypedatedomexiffileinfofiltergdhashiconvjsonlibxmlmbstringmysqliopensslpcrePDOpdo_mysqlpdo_sqlitePharposixReflectionsessionSimpleXMLsoapsocketsSPLsqlite3standardtokenizerxmlxmlreaderxmlwriterzlib[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 startAH00558: 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 messagehttpd (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 httpdroot60625  0.0  0.4 253824  8948 ?  Ss01:270:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 60629  0.0  0.4 540652  8932 ?  Sl01:270:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 60630  0.0  0.4 540652  8932 ?  Sl01:270:00 /usr/local/httpd2.4/bin/httpd -k startdaemon 60631  0.0  0.4 540652  8932 ?  Sl01:270:00 /usr/local/httpd2.4/bin/httpd -k startroot60718  0.0  0.0 112724988 pts/0 R 01:270:00 grep --color=auto httpd

在这里插入图片描述

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

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

[root@linux-001 php-7.3.0]# iptables -nvLChain INPUT (policy ACCEPT 0 packets, 0 bytes) pkts bytes target  prot opt in  out  sourcedestination3863471M ACCEPT  all  --  ** 0.0.0.0/00.0.0.0/0state RELATED,ESTABLISHED 0  0 ACCEPT  icmp --  ** 0.0.0.0/00.0.0.0/02120 ACCEPT  all  --  lo  * 0.0.0.0/00.0.0.0/01 52 ACCEPT  tcp  --  ** 0.0.0.0/00.0.0.0/0state NEW tcp dpt:22 1263  321K REJECT  all  --  ** 0.0.0.0/00.0.0.0/0reject-with icmp-host-prohibitedChain FORWARD (policy ACCEPT 0 packets, 0 bytes) pkts bytes target  prot opt in  out  sourcedestination 0  0 REJECT  all  --  ** 0.0.0.0/00.0.0.0/0reject-with icmp-host-prohibitedChain OUTPUT (policy ACCEPT 35950 packets, 8196K bytes) pkts bytes target  prot opt in  out  sourcedestination[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<?phpphpinfo();?>[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  -tSyntax 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 用时 0s2019-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 MariaDBMariaDB-backup.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-backup-debuginfo.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-cassandra-engine.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-cassandra-engine-debuginfo.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-client.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-client-debuginfo.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-common.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-common-debuginfo.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-compat.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-connect-engine.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-connect-engine-debuginfo.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-cracklib-password-check.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-cracklib-password-check-debuginfo.x86_64MariaDB-devel.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-devel-debuginfo.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-gssapi-server.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-gssapi-server-debuginfo.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-oqgraph-engine.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-oqgraph-engine-debuginfo.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-rocksdb-engine.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-rocksdb-engine-debuginfo.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-server.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-server-debuginfo.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-shared.x86_64  10.3.14-1.el7.centos mariadb-mainMariaDB-shared-debuginfo.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-test.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-test-debuginfo.x86_6410.3.14-1.el7.centos mariadb-mainMariaDB-tokudb-engine.x86_64 10.3.14-1.el7.centos mariadb-mainMariaDB-tokudb-engine-debuginfo.x86_6410.3.14-1.el7.centos mariadb-main
源文地址:http://www.guoxiongfei.cn/csdn/1504.html
0