码迷,mamicode.com
首页 > Web开发 > 详细

Centos7 安装php-5.6.36

时间:2018-10-09 19:05:00      阅读:649      评论:0      收藏:0      [点我收藏+]

标签:sys   bmc   disable   group   shm   code   strong   home   sem   

  • 相关依赖包的检查与安装
    rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
    rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
    yum -y install zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
    yum -y install freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel
    rpm -qa zlib-devel libxml2-devel libjpeg-devel libjpeg-turbo-devel libiconv-devel
    rpm -qa freetype-devel libpng-devel gd-devel libcurl-devel libxslt-devel

  • 安装其他依赖以其他包
    cd /home/oldboy/tools/
    wget https://ftp.gnu.org/gnu/libiconv/libiconv-1.14.tar.gz #下载安装包 ,yum源中没有
    tar zxvf libiconv-1.14.tar.gz #解压
    ./configure --prefix=/usr/local/libconv
    make
    make install
      安装libiconv软件时,可能会报错:*gets未声明,不在函数内等*

    解决方法:cd /usr/local/libiconv/srclib
    sed -i -e ‘/gets is a security/d‘ ./stdio.in.h
    3.安装其他软件
    wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    yum -y install libmcrypt-devel
    yum -y install mhash
    yum -y install mcrypt
    4.cd /home/tools 上传php-5.6.36.tar.gz
    5.解压:tar -zxvf php-5.6.36.tar.gz
    cd php-5.6.36
    ./configure --prefix=/application/php5.6.36 \
    --with-mysql=/application/mysql \
    --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
    ln -s /application/mysql/lib/libmysqlclient.so.18 /usr/lib64/
    touch ext/phar/phar.phar
    make
    make install
    ln -s /application/php5.6.36/ /application/php
    cp php.ini-production /application/php/lib/php.ini
    cd /application/php/etc/
    cp php-fpm.conf.default php-fpm.conf
    /application/php/sbin/php-fpm 启动php-fpm
    ps -ef |grep php-fpm
    lsof -i:9000
    说明:

    1. --with-mysql=/application/mysql mysql的安装位置
    2. --with-fpm-user=www nginx的用户
    3. --with-fpm-group=www nginx的组
  • Centos7 安装php-5.6.36

    标签:sys   bmc   disable   group   shm   code   strong   home   sem   

    原文地址:http://blog.51cto.com/13754781/2296400

    (0)
    (0)
       
    举报
    评论 一句话评论(0
    登录后才能评论!
    © 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
    迷上了代码!