zoukankan      html  css  js  c++  java
  • 教你编译PHP7 (nginx+mysql+php7)

    操作系统: CentOS Linux, 6.5 64位
    服务器: 阿里云
    空的操作系统,我们从0开始.
    在开始前,请确保你的Linux已联网,已联网,已联网!

    
    # 安装编译工具:
    yum install gcc automake autoconf libtool gcc-c++
    
    # 安装基础库
    yum install gd zlib zlib-devel openssl openssl-devel libxml2 libxml2-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libmcrypt libmcrypt-devel
    
    
    # 安装mysql
    yum install mysql mysql-server
    
    
    # 下载pcre 正则库
    wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.37.tar.bz2
    tar jxf pcre-8.37.tar.bz2
    
    
    #编译nginx
    cd /usr/local/src
    
    wget http://nginx.org/download/nginx-1.8.0.tar.gz
    tar zxf nginx-1.8.0.tar.gz
    
    cd nginx-1.8.0
    ./configure --prefix=/usr/local/nginx --with-pcre=/usr/local/src/pcre-8.37
    make && make install
    
    
    # 编译PHP
    cd /usr/local/src
    wget http://cn2.php.net/get/php-7.0.0.tar.bz2/from/this/mirror
    mv mirror php-7.0.0.tar.bz2
    tar jxf php-7.0.0.tar.bz2
    
    cd php-7.0.0
    
    ./configure --prefix=/usr/local/php 
    --with-gd 
    --with-freetype-dir 
    --enable-gd-native-ttf 
    --enable-mysqlnd 
    --with-pdo-mysql=mysqlnd 
    --with-openssl 
    --with-mcrypt 
    --enable-mbstring 
    --enable-zip 
    --enable-fpm
    
    make && make install
    
    # 复制配置文件
    cp /usr/local/src/php-7.0.0/php.ini-development /usr/local/php/lib/php.ini
    cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf
    cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf
    
    
    
    # 整合nginx+php
    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;
    }
    
    
    # 启动php 和nginx
    /usr/local/php/sbin/php-fpm
    /usr/local/nginx/sbin/nginx
    

    写测试PHP页面

    
    <?php
    # /usr/local/nginx/html/a.php
    phpinfo();
    

    打开浏览器: http://xxxxxx/a.php

  • 相关阅读:
    red hat linux下安装mysql
    oracle数据库sys与system默认密码
    eclipse 创建maven web项目
    mysql-5.7.17-winx64的安装配置
    有趣的浏览器地址栏JavaScript代码
    jsp自定义标签Tag
    exp:CollectionSecurity must be empty, but is not; jsp自定义标签异常
    java中&与&&的区别
    解决springmvc在multipart/form-data方式提交请求在过滤器Filter中获取不到参数的问题
    java itextpdf使用HTML模板生成pdf文件,并设置table
  • 原文地址:https://www.cnblogs.com/herry52/p/5650667.html
Copyright © 2011-2022 走看看