>

美洲杯在线投注_2019美洲杯外围投注[投注官网]

热门关键词: 美洲杯在线投注,2019美洲杯外围投注[投注官网]

美洲杯在线投注:Centos6.4 编译安装 nginx php

- 编辑:美洲杯在线投注 -

美洲杯在线投注:Centos6.4 编译安装 nginx php

一. 准备依赖库

安装gcc g 等编译器

安装make:

yum -y install gcc gcc-c   automake autoconf libtool glibc make
yum -y install gcc automake autoconf libtool make

 

安装g :

 

yum install gcc gcc-c  

安装一些lnmp依赖的库

二. 编译安装pcre

 

pcre 是一个正则表达式的库,编译nginx需要依赖该库实现url rewrite

yum -y install

下载源码

libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel

cd /usr/local/src  wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.33.tar.bz2  tar jxvf pcre-8.33.tar.bz2

美洲杯在线投注,libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel

编译安装

zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel

cd pcre-8.33  ./configure  make  make install

ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel

三. 编译安装zlib库

krb5 krb5-devel libidn libidn-devel openssl openssl-devel

zlib 是gzip实现

 

下载源码

好像centos 6.0 后都yum 安装不了libmcrypt了
不解决这个问题,编译不了php,~~~~安装libmcrypt

cd /usr/local/src  wget http://zlib.net/zlib-1.2.8.tar.gz  tar -zxvf zlib-1.2.8.tar.gz

tar -zxvf libmcrypt-2.5.7.tar.gz

编译安装

 ./configure --prefix=/usr/local/libmcrypt

cd zlib-1.2.8
./configure  make  make install

make && make install

四. 安装openssl

 

检查是否安装了ssl


# rpm -qa|grep openssl  openssl-devel-1.0.1e-16.el6_5.14.x86_64  openssl-1.0.1e-16.el6_5.14.x86_64

make[2]: Leaving directory `/usr/local/src/libmcrypt-2.5.7/src'

如果没有安装

Making all in doc

下载源码

make[2]: Entering directory `/usr/local/src/libmcrypt-2.5.7/doc'

cd /usr/local/src  wget http://www.openssl.org/source/openssl-1.0.1c.tar.gz  tar -zxvf openssl-1.0.1c.tar.gz

make[2]: Nothing to be done for `all'.

编译安装

make[2]: Leaving directory `/usr/local/src/libmcrypt-2.5.7/doc'

./configure  make  make install

make[2]: Entering directory `/usr/local/src/libmcrypt-2.5.7'

五. 编译安装nginx

make[2]: Leaving directory `/usr/local/src/libmcrypt-2.5.7'

cd /usr/local/src  wget http://nginx.org/download/nginx-1.2.8.tar.gz  tar -zxvf nginx-1.2.8.tar.gz  cd nginx-1.2.8

make[1]: Leaving directory `/usr/local/src/libmcrypt-2.5.7'

  ./configure --sbin-path=/usr/local/nginx/nginx
  --conf-path=/usr/local/nginx/nginx.conf
  --pid-path=/usr/local/nginx/nginx.pid
  --with-http_ssl_module
  --with-pcre=/usr/local/src/pcre-8.33
  --with-zlib=/usr/local/src/zlib-1.2.8
  --with-openssl=/usr/local/src/openssl-1.0.1c


  make
  make install

报这个错没关系,只要不是error就行,这个提示的意思是离开当前目录的意思。

安装成功完毕后验证是否安装成功

 

/usr/local/nginx/nginx   netstat -alptn|grep 80

安装**PHP**

六. 编译安装php

下载地址:http://php.net/downloads.php

新版本的php中已经集成了php-fpm 

 

  1. 准备工作

    yum -y install libmcrypt-devel mhash-devel libxslt-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel

  2. 源码编译安装libmcrypt

    wget ftp://mcrypt.hellug.gr/pub/crypto/mcrypt/attic/libmcrypt/libmcrypt-2.5.7.tar.gz tar -zxvf libmcrypt-2.5.7.tar.gz cd libmcrypt-2.5.7 ./configure make make install

  3. 下载源码

    wget http://cn2.php.net/distributions/php-5.4.7.tar.gz tar zvxf php-5.4.7.tar.gz

  4. 编译安装cd php-5.4.7

    ./configure --prefix=/usr/local/php

             --enable-fpm                                   
             --enable-mbstring                              
             --enable-sockets                               
             --enable-sysvsem                               
             --enable-sysvshm                               
             --enable-pcntl                                 
             --enable-mbregex                               
             --enable-zip                                   
             --enable-inline-optimization                   
             --disable-pdo                                  
             --disable-debug                                
             --disable-rpath                                
             --with-mcrypt                                  
             --with-zlib                                    
             --with-bz2                                     
             --with-mhash                                   
             --with-curl                                    
             --with-mysql                                   
             --with-gd                                      
             --with-pcre-regex                              
             --with-libdir=lib64
    
tar -zxvf php-5.4.21.tar.gz    cd php-5.4.21

如果报如下错误

 

configure: error: Don't know how to define struct flock on this system, set --enable-opcache=no
./configure --prefix=/usr/local/php  --enable-fpm   --with-mcrypt=/usr/local/libmcrypt   --enable-mbstring --disable-pdo --with-curl --disable-debug  --disable-rpath   --enable-inline-optimization --with-bz2  --with-zlib --enable-sockets   --enable-sysvsem --enable-sysvshm --enable-pcntl --enable-mbregex   --with-mhash --enable-zip --with-pcre-regex --with-mysql --with-mysqli   --with-gd --with-jpeg-dir

修改 /etc/ld.so.conf 文件

 

vi /etc/ld.so.conf.d/local.conf  #添加2行
/usr/local/lib64   //64系统
/usr/local/src/libmcrypt-2.5.7/lib/.libs

#执行以下命令
chmod gu x /etc/ld.so.conf.d/local.conf

#执行以下命令使生效
ldconfig -v

若出现报错 参考 http://www.cnblogs.com/wangxusummer/p/4094340.html

再次执行命令

 

成功后编译安装

make && make install

七. 配置启动

 

  1. 配置php-fpm

    cd /usr/local/php cp /etc/php-fpm.conf.default /etc/php-fpm.conf vi /etc/php-fpm.conf

添加www用户组,添加www用户,并将www用记添加到www用户组

修改
user = llong
group = llong

groupadd www    useradd -g www www
  1. 修改nginx 支持 php-fpm

 

打开 nginx.conf 

 

其中server段增加如下配置,注意标红内容配置,否则会出现No input file specified.错误

拷贝php-fpm配置文件

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000  #  location ~ .php$ {  root html;  fastcgi_pass 127.0.0.1:9000;  fastcgi_index index.php;  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;  include fastcgi_params;  }

 

  1. 测试是否配置成功
cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf

在/usr/local/nginx/html下创建index.php文件,输入如下内容

 

<?   echo phpinfo();   ?>

 

启动php-fpm和nginx

更改配制文件

/usr/local/php/sbin/php-fpm (手动打补丁的启动方式/usr/local/php/sbin/php-fpm start)     /usr/local/nginx/nginx
vim /usr/local/php/etc/php-fpm.conf 

 

 

 

25 行前面分号去掉 pid为php-fpm产生的进程号


148 149行,user group 都改为www

 pid = run/php-fpm.pid     user = www     group = www

 

 

拷贝php配置文件 到php默认的配置文件路径

cp php.ini-production /usr/local/php/lib/php.ini

 

ln -s /usr/local/php/bin/php /usr/bin/php

本文由计算机教程发布,转载请注明来源:美洲杯在线投注:Centos6.4 编译安装 nginx php