zoukankan      html  css  js  c++  java
  • php7安装

    初始环境

    [root@php7 ~]# cat /etc/redhat-release
    CentOS Linux release 7.4.1708 (Core) 
    [root@php7 ~]# getenforce
    Disabled
    [root@php7 ~]# systemctl status firewalld.service
    ● firewalld.service - firewalld - dynamic firewall daemon
       Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
       Active: inactive (dead)
         Docs: man:firewalld(1)
    [root@php7 ~]# 
    View Code

    1.安装nginx

    前面的博文已写编译安装nginx点击在这里

    2.安装php

    下载地址:

    http://cn2.php.net/distributions/php-7.1.1.tar.gz

    提示:php7中已废弃了mysql_connect()系列的函数,可以删除此参数 --with-mysql=mysqlnd

    # 解决依赖
     yum install -y zlib-devel openssl-devel pcre-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libivonv-devel freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel libxslt-devel bzip2-devel readline-devel recode recode-devel libtidy libtidy-devel libmcrypt-devel mhash mcrypt
    ./configure --prefix=/application/php-7.1.1 --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-iconv-dir=/usr/local/libiconv --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr --enable-xml --disable-rpath --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --enable-mbregex --enable-fpm --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-soap --enable-short-tags --enable-static --with-xsl --with-fpm-user=www --with-fpm-group=www --enable-ftp --enable-opcache=no
    
    make #时间会有点长
    
    make install #所以我会把它包为rpm
    # 创建php软件链接
    ln -s /application/php-7.1.1/ /application/php
    
    # 配置php-fpm.conf
    mkdir /application/php/etc/ -p
    \cp /server/tools/php-7.1.1/sapi/fpm/php-fpm.conf /application/php/etc/
    \cp /server/tools/php-7.1.1/sapi/fpm/php-fpm.conf /application/php/etc/
    \cp /application/php/etc/php-fpm.d/www.conf.default /application/php/etc/php-fpm.d/www.conf
    
    # 配置php.ini
    mkdir /application/php/lib/ -p
    \cp /server/tools/php-7.1.1/php.ini-production /application/php/lib/php.ini
    vim /application/nginx/conf/nginx.conf
    # 在server模块中加入 index.php 
        location / {
            root   html;
            index  index.php index.html index.htm;
        }
    
    # 在server模块中添加
        location ~* .*\.(php|php5)?$ {
                    root html;
                    fastcgi_pass  127.0.0.1:9000;
                    fastcgi_index index.php;
                    include fastcgi.conf;
        }
    # 检查nginx配置状态
    /application/nginx/sbin/nginx -t
    
    # 重启nginx 
    /application/nginx/sbin/nginx -s reload
    # 启动php-ftp程序
    /application/php/sbin/php-fpm
    
    # 输入phpinfo
    
    echo -e '<?php \n phpinfo();\n ?>' > /application/nginx/html/index.php

     3.结果图

    此处没写连接mysql.读者可以到这里查看安装mysql

  • 相关阅读:
    HDU 1358 Period (KMP)
    POJ 1042 Gone Fishing
    Csharp,Javascript 获取显示器的大小的几种方式
    css text 自动换行的实现方法 Internet Explorer,Firefox,Opera,Safar
    Dynamic Fonts动态设置字体大小存入Cookie
    CSS Image Rollovers翻转效果Image Sprites图片精灵
    CSS three column layout
    css 自定义字体 Internet Explorer,Firefox,Opera,Safari
    颜色选择器 Color Picker,Internet Explorer,Firefox,Opera,Safar
    CSS TextShadow in Safari, Opera, Firefox and more
  • 原文地址:https://www.cnblogs.com/anyux/p/8087524.html
Copyright © 2011-2022 走看看