• (3)编译安装lamp三部曲之php-技术流ken


    简介

    php是服务器端脚本语言,我们需要使用它来提供动态的网页。接下来就来编译安装php吧。

    系统环境及服务版本

    centos7.5

    服务器IP:172.20.10.7/28

    libmcrypt-devel-2.5.8-9

    libmcrypt-2.5.8-9

    php-5.4.10

    准备依赖文件以及php安装包

    [root@ken ~]# ls
    libmcrypt-devel-2.5.8-9.el6.x86_64.rpm  php-5.4.10.tar.gz
    libmcrypt-2.5.8-9.el6.x86_64.rpm  

    安装依赖包

    [root@ken ~]# yum install libmcrypt-devel libxml2-devel bzip2-devel openssl-devel -y
    [root@ken ~]# rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm 
    [root@ken ~]# rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm 

    编译安装php

    [root@ken ~]# tar xf php-5.4.10.tar.gz 
    [root@ken ~]# cd php-5.4.10
    [root@ken php-5.4.10]# ./configure 
    --prefix=/usr/local/php 
    --with-config-file-path=/etc/ 
    --with-config-file-scan-dir=/etc/php.d 
    --with-mysql=/usr/local/mysql 
    --with-openssl 
    --with-mysqli=/usr/local/mysql/bin/mysql_config 
    --with-jpeg-dir --with-png-dir --enable-xml 
    --with-zlib --enable-mbstring --with-freetype-dir 
    --enable-sockets --with-mcrypt --with-bz2 --enable-fpm 
    && make && make install

    生成php的配置文件

    [root@ken php-5.4.10]# cp /root/php-5.4.10/php.ini-production /etc/php.ini

    配置php-fpm

    1.生成php-fpm的管理脚本(解压目录下)

    [root@ken php-5.4.10]# cp /root/php-5.4.10/sapi/fpm/init.d.php-fpm /etc/init.d/php-fpm
    [root@ken php-5.4.10]# chmod +x /etc/init.d/php-fpm       #加入执行权限
    [root@ken php-5.4.10]# chkconfig --add php-fpm            #加入系统启动项
    [root@ken php-5.4.10]# chkconfig php-fpm on               #开机自启动

    2.配置php-fpm的配置文件(安装目录下)

    [root@ken php-5.4.10]# cd /usr/local/php/etc/
    [root@ken etc]# cp php-fpm.conf.default php-fpm.conf
    [root@ken etc]# vim php-fpm.conf
    ...
    143 ; The address on which to accept FastCGI requests.
    144 ; Valid syntaxes are:
    145 ;   'ip.add.re.ss:port'    - to listen on a TCP socket to a specific address on
    146 ;                            a specific port;
    147 ;   'port'                 - to listen on a TCP socket to all addresses on a
    148 ;                            specific port;
    149 ;   '/path/to/unix/socket' - to listen on a unix socket.
    150 ; Note: This value is mandatory.
    151 listen = 127.0.0.1:9000       #151处的listen如果使用动静分离这里需要更改为本机ip地址,不能使用本地回环地址哦
    152 
    153 ; Set listen(2) backlog.
    154 ; Default Value: 128 (-1 on FreeBSD and OpenBSD)
    155 ;listen.backlog = 128
    ...

    启动php-fpm

    [root@ken etc]# systemctl restart php-fpm
    [root@ken etc]# ss -tnl        #检测php-fpm是否启动
    State       Recv-Q Send-Q               Local Address:Port                              Peer Address:Port              
    LISTEN      0      128                      127.0.0.1:9000                                         *:*                  
    LISTEN      0      50                               *:3306                                         *:*                  
    LISTEN      0      128                              *:22                                           *:*                  
    LISTEN      0      100                      127.0.0.1:25                                           *:*                  
    LISTEN      0      128                             :::22                                          :::*                  
    LISTEN      0      100                            ::1:25                                          :::*      

    启动成功!

     lamp所需服务在三篇博文中已经全部实现,现在你可以尝试着把它们装在一台服务器上面,或者采用动静分离,数据库分离的方式使得你的服务器真正成为HPC啦。快来试一下吧

  • 相关阅读:
    scan design rules
    scan cell
    DFT basics
    测试性分析
    DFT设计绪论
    clock gate cell
    Linux命令
    Multi-voltage和power gating的实现
    Power Gating的设计(架构)
    Power Gating的设计(模块二)
  • 原文地址:https://www.cnblogs.com/kenken2018/p/9727129.html
Copyright © 2020-2023  润新知