Linux下编译安装PCRE库
备注:如果没有root权限,使用 --prefix 指定安装路径
./configure --prefix=/home/work/tools/pcre-8.xx
======================================================
最近在学习nginx,nginx rewrite依赖于PCRE库,所以需要在linux系统中编译安装PCRE库。具体步骤如下:
1.下载PCRE包
首先去官网下载pcre的安装包
如果通过FTP的方式,下载地址为:ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
如果通过http的方式,下载地址为:http://sourceforge.net/projects/pcre/files/pcre/
目前最新的版本为8.32,linux对应的安装包名称为:pcre-8.32.tar.gz。
2.把安装包上传到服务器,然后解压
- [root@localhost local]# tar -zxvf pcre-8.32.tar.gz
解压之后在当前目录下生成了一个文件夹:pcre-8.32
- drwxr-xr-x 7 1169 1169 4096 Nov 30 18:50 pcre-8.32
3.配置
- [root@localhost pcre-8.32]# ./configure
配置完之后控制台会打印出pcre配置的摘要信息
- pcre-8.32 configuration summary:
- Install prefix .................. : /usr/local
- C preprocessor .................. : gcc -E
- C compiler ...................... : gcc
- C++ preprocessor ................ : g++ -E
- C++ compiler .................... : g++
- Linker .......................... : /usr/bin/ld
- C preprocessor flags ............ :
- C compiler flags ................ : -O2 -fvisibility=hidden
- C++ compiler flags .............. : -O2 -fvisibility=hidden -fvisibility-inlines-hidden
- Linker flags .................... :
- Extra libraries ................. :
- Build 8 bit pcre library ........ : yes
- Build 16 bit pcre library ....... : no
- Build 32 bit pcre library ....... : no
- Build C++ library ............... : yes
- Enable JIT compiling support .... : no
- Enable UTF-8/16/32 support ...... : no
- Unicode properties .............. : no
- Newline char/sequence ........... : lf
- \R matches only ANYCRLF ......... : no
- EBCDIC coding ................... : no
- EBCDIC code for NL .............. : n/a
- Rebuild char tables ............. : no
- Use stack recursion ............. : yes
- POSIX mem threshold ............. : 10
- Internal link size .............. : 2
- Match limit ..................... : 10000000
- Match limit recursion ........... : MATCH_LIMIT
- Build shared libs ............... : yes
- Build static libs ............... : yes
- Use JIT in pcregrep ............. : no
- Buffer size for pcregrep ........ : 20480
- Link pcregrep with libz ......... : no
- Link pcregrep with libbz2 ....... : no
- Link pcretest with libedit ...... : no
- Link pcretest with libreadline .. : no
- Valgrind support ................ : no
- Code coverage ................... : no
4.编译
执行make操作:
- [root@localhost pcre-8.32]# make
编译完后可以执行make check进行测试(这一步非必须)
- Testing pcregrep version 8.32 2012-11-30
- Testing pcregrep main features
- Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library
- Testing pcregrep newline settings
- PASS: RunGrepTest
- ==================
- All 5 tests passed
- ==================
- make[2]: Leaving directory `/usr/local/pcre-8.32'
- make[1]: Leaving directory `/usr/local/pcre-8.32'
- [root@localhost pcre-8.32]#
上面的make check结果中有一句:
- Skipping pcregrep UTF-8 tests: no UTF-8 support in PCRE library
这是因为在前面步骤中执行./configuration配置时没有加上对utf-8的支持
如果要加上对utf-8的支持可以在./configuration时加上参数:
- [root@localhost pcre-8.32]# ./configure --enable-utf8
配置完后再重新make
make完后再次执行make check结果如下:
- Testing pcregrep version 8.32 2012-11-30
- Testing pcregrep main features
- Testing pcregrep UTF-8 features
- Testing pcregrep newline settings
- PASS: RunGrepTest
- ==================
- All 5 tests passed
- ==================
- make[2]: Leaving directory `/usr/local/pcre-8.32'
- make[1]: Leaving directory `/usr/local/pcre-8.32'
- [root@localhost pcre-8.32]#
5.安装
执行make install操作:
- [root@localhost pcre-8.32]# make install
make install结束后pcre编译安装流程就结束了。
Linux下编译安装PCRE库的更多相关文章
- linux下编译安装boost库
linux下编译安装boost库 linux下编译安装boost库 1.下载并解压boost 1.58 源代码 下载 解压 2.运行bootstrap.sh 3.使用b2进行构建 构建成功的提示 4. ...
- linux下编译安装nginx
1.首先下载稳定版nginx1.10.2 使用wget命令下载 wget http://nginx.org/download/nginx-1.10.2.tar.gz 2.然后解压 tar -zxvf ...
- LINUX下编译安装PHP各种报错大集合
本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...
- Linux下编译安装Apache Http Server
Linux下编译安装Apache Http Server [TOC] 1.下载httpd-2.4.12.tar.bz2 wget http://mirror.bit.edu.cn/apache/htt ...
- Linux下编译安装qemu和libvirt
目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 2 安装libvirt 2.1 libvirt介绍 2.2 下载libvirt 2.3 编译安装 3 ...
- Linux下编译安装qemu和libvirt【转】
转自:http://www.cnblogs.com/findumars/p/5679742.html 目录 [hide] 1 安装qemu 1.1 qemu介绍 1.2 下载源文件 1.3 编译安装 ...
- (转)Linux下编译安装log4cxx
Linux下编译安装log4cxx 一个项目的服务器端在Linux平台下,用到了开源日志库log4cxx,这个库是apache项目的一个子库.功能很不错.下面记录下它的编译和安装过程. log4cxx ...
- linux安装软件的几种方法----linux下编译安装软件的一般步骤
linux安装软件的几种方法: 一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root用户: 3.cd so ...
- linux下编译安装vim7.4并安装clang_complete插件
linux下编译安装vim7.4并安装clang_complete插件 因为debian里软件仓库中下载安装的vim是不支持python写的插件的(可以打开vim,在命令模式先输入:py测试一下),导 ...
随机推荐
- LayoutInflater和inflate()
LayoutInflater LayoutInflater抽象类是用来加载XML布局文件(UI界面)的. 作用: 1.对于一个没有被载入或者想要动态载入的界面,都需要使用LayoutInflater. ...
- banner秒杀
永远显示 未开始/进行中(需要用到两个for循环,第一个我没有想到,诗詹帮我写的) function timeList(){ myTime = new Date().getTime() var ite ...
- WPF:换肤
看了一篇博客,觉得样式很好看,就自己动手做了一下,做个总结. 效果: 选择不同的图片背景就会改变: 直接上代码: 每个Theme对应一张图,除了图的名称不同之外,Theme?.xaml中的内容相 ...
- git: No refs in common and none specified; doing no
用gitolite新建项目,clone后首次push,可能会出现: $ git push No refs in common and none specified; doing nothing ...
- sql server 自增长id 允许插入显示值
--允许插入显示插入主键id的值SET IDENTITY_INSERT [T0002_SType] ON 执行insert插入语句------------------ --关闭 插入显示值SET ID ...
- 0518Scrum项目5.0
1.团队成员完成自己认领的任务. 2.燃尽图:理解.设计并画出本次Sprint的燃尽图的理想线.参考图6. 3.每日立会更新任务板上任务完成情况.燃尽图的实际线,分析项目进度是否在正轨. 每天的 ...
- 不错的TOMCAT监控好工具probe
Tomcat版本:6.0.41 Probe版本:2.3.3 一,Tomcat没有默认用户账号,故首先需要添加Tomcat用户账号 修改$CATALINA_HOME/conf/tomcat-users. ...
- 爱默生UPS并机系统:进入与退出操作方法
UPS并机系统的进入与退出: 进入:.合UPS的出线及进线开关:开启第一台UPS,等待整流指示灯常亮.然后Invert On,正常开机,此时UPS进入逆变状态 .合另外一台UPS的出线及进线开关,等待 ...
- [Jquery]判断数据类型
typeof [1, 2, 4] === 'object';typeof new Date() === 'object'; typeof null === 'object'; 由于typeof数组. ...
- 使用Jsoup 抓取页面的数据
需要使用的是jsoup-1.7.3.jar包 如果需要看文档我下载请借一步到官网:http://jsoup.org/ 这里贴一下我用到的 Java工程的测试代码 package com.javen ...