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

    1、下载源码包程序

    # mkdir /tmp/php_build

    # cd /tmp/php_build

    # wget http://cn2.php.net/distributions/php-7.2.9.tar.xz  ##有其他版本,这是比较老的版本了

    2、安装依赖

    # yum install -y gcc-c++ libxml2-devel libxml2-devel libcurl-devel libcurl-devel openssl-devel libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel

    3、创建用户和组

    # groupadd -r www

    # useradd -s /usr/sbin/nologin -r -M -N www

    4、编译安装

    # tar Jxvf php-7.2.9.tar.xz -C /usr/local/

    # cd /usr/local/php-7.2.9

    # /configure

       --prefix=/usr/local/php-7.2.9

       --with-config-file-path=/usr/local/php-7.2.9/etc

       --bindir=/usr/local/php-7.2.9/bin

       --sbindir=/usr/local/php-7.2.9/sbin

       --enable-fpm

       --with-fpm-user=www

       --with-fpm-group=www

       --enable-mysqlnd

       --with-mysqli=mysqlnd

       --with-pdo-mysql=mysqlnd

       --with-iconv-dir

       --with-freetype-dir=/usr/local/freetype

       --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-mbstring

       --with-gd

       --with-openssl

       --enable-pcntl

       --enable-sockets

       --with-mhash

       --with-xmlrpc

       --enable-zip

       --enable-soap

       --with-gettext

       --disable-fileinfo

       --enable-opcache

       # make -j `grep processor /proc/cpuinfo | wc -l`

       # make install  #安装完成后会生成/usr/local/php-7.2.9路径

     #后面根据需要修改PHP监听方式就可以了,一种是sock,一种是端口

     #vim /usr/local/php-7.2.12/etc/php-fpm.d/www.conf 

    listen = /usr/local/php-7.2.9/var/run/php-7.2.9.sock
    或listen = 0.0.0.0:9000;

       #启动命令路径,执行后会有一个PHP主进程很若干个子进程

       #/usr/local/php-7.2.9/sbin/php-fpm

  • 相关阅读:
    mysql 5.7 安装手册(for linux)
    Git服务器分类
    Git服务器安装详解及安装遇到问题解决方案
    使用git进行版本管理
    Git 忽略一些文件不加入版本控制
    Windows下搭建基于SSH的Git服务器
    linux系统下mysql跳过密码验证登录和创建新用户
    阅读《不止代码》之心得分享
    Sonar安装和常见问题解决
    Eclipse安装Sonarlint插件
  • 原文地址:https://www.cnblogs.com/Christine-ting/p/11328071.html
Copyright © 2011-2022 走看看