.选定源码目录
选定目录 /data/klj/

cd /data/klj/

2.安装PCRE库
cd /data/klj/
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.34.tar.gz
tar -zxvf pcre-8.21.tar.gz
cd pcre-8.21
./configure
make
make install

3.安装zlib库
cd /data/klj/
wget http://zlib.net/zlib-1.2.8.tar.gz
tar -zxvf zlib-1.2.8.tar.gz cd zlib-1.2.8
./configure
make
make install

4.安装ssl

cd /data/klj/
wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz
tar -zxvf openssl-1.0.1c.tar.gz
./config
make
make install

5.安装nginx

Nginx 一般有两个版本,分别是稳定版和开发版,您可以根据您的目的来选择这两个版本的其中一个,下面是把 Nginx 安装到 /usr/local/nginx 目录下的详细步骤:

cd /data/klj/
wget http://nginx.org/download/nginx-1.7.8.tar.gz
tar -zxvf nginx-1.2.8.tar.gz
cd nginx-1.2.8
./configure --with-pcre=/data/klj/pcre-8.21 --with-zlib=/data/klj/zlib-1.2.8 --with-openssl=/data/klj/openssl-1.0.1c --prefix=/usr/local/nginx
make
make install

安装php
下载php安装包
wget http://cn2.php.net/get/php-5.6.3.tar.gz/from/this/mirror

tar -zxvf php-5.6.3.tar.gz
cd php-5.6.3

./configure --prefix=/data/klj/php --with-config-file-path=/data/klj/php/etc --with-mysql --with-mysqli --with-iconv-dir=/usr/local --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-pdo --with-pdo-mysql=mysqlnd

./configure --prefix=/data/klj/php --with-config-file-path=/data/klj/php/etc --with-mysql --with-mysqli --enable-mbstring --enable-sockets --enable-pcntl --enable-zip --enable-bcmath --with-zlib-dir --with-bz2 --with-freetype-dir --with-gd --with-libxml-dir --with-png-dir --with-jpeg-dir=/usr/local/jpeg --enable-mbstring --with-mcrypt --with-curl --enable-fasecgi --enable-fpm

./configure --prefix=/data/klj/php-5.6.14 --with-config-file-path=/data/klj/php-5.6.14/etc --with-mysql --with-mysqli --with-iconv-dir=/usr/local --with-freetype-dir=/usr/local/freetype --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-fastcgi --enable-fpm --enable-force-cgi-redirect --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-ldap --with-ldap-sasl --with-xmlrpc --enable-zip --enable-soap --enable-pdo --with-pdo-mysql=mysqlnd --with-png-dir=/usr/local/png --with-jpeg-dir=/usr/local/jpeg --enable-mbstring --with-mcrypt --with-curl --enable-fasecgi --enable-fpm

error 5

checking whether to enable JIS-mapped Japanese font support in GD... no
checking for fabsf... yes
checking for floorf... yes
configure: error: jpeglib.h not found
GD库没有安装
解决办法
yum install libjpeg.x86_64 libpng.x86_64 freetype.x86_64 libjpeg-devel.x86_64 libpng-devel.x86_64 freetype-devel.x86_64 -y

1)去网站 http://www.ijg.org/ 下载源码。我用的版本是jpegsrc.v8d.tar.gz,执行命令:sudo tar -zxvf jpegsrc.v8d.tar.gz -C /usr/src

(2)进入/usr/src/jpegsrc.v8d目录,sudo方式执行命令:sudo ./configure --prefix=/usr/local/jpeg;make;make install;

(3)重新编译php,增加参数--with-jpeg-dir=/usr/local/jpeg

再次编译,遇到问题:configure: error: mcrypt.h not found. Please reinstall libmcrypt.

(1)去网站http://mcrypt.hellug.gr/lib/index.html 的下载源码,我下的版本是libmcrypt-2.5.7.tar.gz;执行命令:sudo tar -zxvf libmcrypt-2.5.7.tar.gz -C /usr/src

(2)进入/usr/src/libmcrypt-2.5.7目录,sudo方式执行命令:./configure prefix=/usr/local/libmcrypt/;make ;make install

(3)重新编译php,这时增加参数--with-mcrypt=/usr/local/libmcrypt

先安装Libmcrypt

#tar -zxvf libmcrypt-2.5.8.tar.gz
#cd libmcrypt-2.5.8
#./configure
#make
#make install 说明:libmcript默认安装在/usr/local

3.安装mhash

#tar -zxvf mhash-0.9.9.9.tar.gz
#cd mhash-0.9.9.9
#./configure
#make
#make install
4.安装mcrypt

#tar -zxvf mcrypt-2.6.8.tar.gz
#cd mcrypt-2.6.8
#LD_LIBRARY_PATH=/usr/local/lib ./configure
#make
#make install

此安装主要针对Linux系统
首先要下载三个软件,分别是
libmcrypt-2.5.8.tar.gz
下载地址:

wget http://sourceforge.net/projects/mcrypt/files/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz/download

mhash-0.9.9.tar.gz
下载地址: wget http://sourceforge.net/projects/mhash/files/mhash/0.9.9.9/mhash-0.9.9.9.tar.gz/download
mcrypt-2.6.8.tar.gz
下载地址:

wget http://sourceforge.net/projects/mcrypt/files/MCrypt/2.6.8/mcrypt-2.6.8.tar.gz/download

nginx php 安装的更多相关文章

  1. Nginx服务安装配置

    1.Nginx介绍 Nginx是一个高性能的HTTP和反向代理服务器,由俄罗斯人开发的,第一个版本发布于2004年10月4日.Nginx由于出色的性能,在世界范围内受到了越来越多人的关注,其特点是占有 ...

  2. Django Nginx+uwsgi 安装配置

    使用 python manage.py runserver 来运行服务器.这只适用测试环境中使用. 正式发布的服务,我们需要一个可以稳定而持续的服务器,比如apache, Nginx, lighttp ...

  3. mysql 自动备份和nginx自动安装脚本

    一.自动备份Mysql脚本: 如下脚本为mysql自动备份脚本,仅供参考,可以根据实际情况修改. #!/bin/sh #auto backup mysql #wugk #Define PATH定义变量 ...

  4. nginx的安装

    1,,nginx的安装 为什么使用nginx我就不多说了,很优秀的,请再行google 在安装前,先安装pcre,安装zlib,安装openssl,以及一些其他包 yum install -y gcc ...

  5. nginx编译安装

    Nginx编译安装 1.nginx官网:http://wiki.nginx.org/Install下载:http://nginx.org/en/download.html 2.编译安装# wget h ...

  6. nginx 的安装

    一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # yum install pcre* //如过你已经装了,请跳过这一步 2.安装openssl ...

  7. linux/centos下安装nginx(rpm安装和源码安装)详细步骤

    Centos下安装nginx rpm包                                                                                 ...

  8. nginx的安装与配置

    1.nginx的安装与配置 编译安装nginx需要实现安装开发包组“Development tools”和“Server Platform Development”.“Desktop Platform ...

  9. nginx笔记----安装

    nginx的安装 ./configure make && make install (一)准备条件: 1.GCC---gun编译器集合 Nginx是一个由C语言编写的程序,因此首先需要 ...

  10. Linux下Nginx的安装、升级及动态添加模块

    系统基于ubuntu server 14.04.4 amd64 安装 第一步 下载并解压Nginx压缩包 从Nginx官网下载Nginx,或者在Linux上执行wget http://nginx.or ...

随机推荐

  1. 如何正确地使用Python的属性和描述符

    关于@property装饰器 在Python中我们使用@property装饰器来把对函数的调用伪装成对属性的访问. 那么为什么要这样做呢?因为@property让我们将自定义的代码同变量的访问/设定联 ...

  2. 理论沉淀:RANSAC算法

    1.解决问题: 当一组样本数据中含有(较小波动的)正常数据(inliers)和(较大波动的)异常数据(outliers)且异常数据的量还不小于正常数据的量时,用最小二乘法将难以获得期望的直线(即能拟合 ...

  3. Codeforces 622F 「数学数论」「数学规律」

    题意: 给定n和k,求 1 ≤ n ≤ 109, 0 ≤ k ≤ 106 思路: 题目中给的提示是对于给定的k我们可以求出一个最高次为k+1的关于n的通项公式. 根据拉格郎日插值法,我们可以通过k+2 ...

  4. poj 2485 Highways 最小生成树

    点击打开链接 Highways Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19004   Accepted: 8815 ...

  5. 2013 ACM 通化邀请赛 A. Tutor

    A. Tutor Description Lilin was a student of Tonghua Normal University. She is studying at University ...

  6. Remove Duplicates from Sorted List(链表)

    Given a sorted linked list, delete all duplicates such that each element appear only once. For examp ...

  7. Hadoop修改SSH端口号

    hadoop-env.sh export HADOOP_SSH_OPTS="-p 16022"

  8. docker-tomcat-nginx 反向代理和负载均衡

    1.部署tomcat镜像 下载官方的tomcat镜像. -jre7 启动docker容器,2个实例,分别映射不同的端口号, ~/work/sample-webapps/[v1.0|v2.0]/下面存放 ...

  9. SQL增加,删除,更改表中字段

    1. 向表中添加新的字段 alter  table  table_name  add  column_name  varchar2(20) not null 2. 删除表中的一个字段 delete t ...

  10. 学习记录 彻底搞清 C#中a++与++a的区别

    首先 a++和++a 的定义:看个例子A: a=5; b=++a; // 相当于a=a+1;b=a; 结果是a=6,b=6B: a=5; b=a++; // 相当于b=a;a=a+1; 结果是a=6, ...