.选定源码目录
选定目录 /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. Eclipse 常用设置

    1. eclipse中的汉字横着显示怎么解决 同一种字体有两种显示方式,比如Fixedsys Excelsior 3.01和@Fixedsys Excelsior 3.01,前一种汉字是竖着显示,后一 ...

  2. Java8新特性【转】

    地址:http://ifeve.com/java-8-features-tutorial/ 1.简介 毫无疑问,Java 8是自Java  5(2004年)发布以来Java语言最大的一次版本升级,Ja ...

  3. cocos2d-lua 3.5 android搭建步骤

    cocos2d-lua 3.5 android搭建步骤 如何安装eclipse,jdk,android sdk,ndk这里都不说了,资料很多,而且以前用eclipse搭建cocos2d-x-c++的时 ...

  4. [ CodeVS冲杯之路 ] P1092

    不充钱,你怎么AC? 题目:http://codevs.cn/problem/1092/ 嗯,这道题有一定难度啊,需要先用扩展欧几里得算法求出逆元,然后按照大小构一颗带边权为小时数的树 树链剖分后在树 ...

  5. 关于 profile文件(转)

    登录shell执行了两个特殊文件, 1个是:\etc\profile, 这个文件由系统管理员设置,通常做一些如检查是否有邮件,设置默认的创建文件的掩码,给某些表转到处变量赋值,已经任何管理员希望每当用 ...

  6. Drupal8开发教程:认识.info.yml文件

    YAML 文件是新引入的重要项目文件,在 Drupal 8 中,无论是模块.主题还是安装配置文件,都需要 .info.yml 文件来为其存储项目相关的基础信息. 在 Drupal 中,.info.ym ...

  7. 大陆地区OpenStack项目Core现状(截至2016年1月28日,转载自陈沙克日志)

    陈沙克 经常有朋友问,大陆地区大概有多少位OpenStack项目的Core.这个问题,现在其实不太好回答,如果需要准确统计的话.下面仅仅是一个大概估计,有遗漏的,希望朋友指出,我来补全. 文档修改历史 ...

  8. confluence启动关闭

    cd /opt/atlassian/confluence/bin startup.sh shutdown.sh

  9. 启动obiee

    启动obiee:1.启动数据库第一步:打开Oracle监听$ lsnrctl start第二步:使用sysdab角色登录sqlplussqlplus / as sysdba第三步:启动数据库SQL&g ...

  10. 配置Tomcat的JVM的大小解决Tomcat内存溢出的问题

    操作步骤如下图所示(图中也有对应的文字说明已比较详细,不再用文字做过多的解释): 1: 2: 3: 4: 5: 下面是配置的参数的说明: -Xms256m                     JV ...