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

    前提:必须先安装好MySQL以及Apache
     

    1.准备好源码包并配置好yum源,需要的源码包包括:

    libmcrypt-2.5.8-9.el6.x86_64.rpm
    libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
    mhash-0.9.9.9-3.el6.x86_64.rpm
    mhash-devel-0.9.9.9-3.el6.x86_64.rpm
    php-5.5.33.tar.gz

    1.png

     

    2.安装依赖环境包:

    rpm -ivh libmcrypt-2.5.8-9.el6.x86_64.rpm
    rpm -ivh libmcrypt-devel-2.5.8-9.el6.x86_64.rpm
    rpm -ivh mhash-0.9.9.9-3.el6.x86_64.rpm
    rpm -ivh mhash-devel-0.9.9.9-3.el6.x86_64.rpm
    yum install libxml2 -y
    yum install libxml2-devel -y
    yum install bzip2 -y
    yum install bzip2-devel
    yum install libjpeg -y
    yum install libjpeg-devel -y
    yum install libpng -y
    yum install libpng-devel -y
    yum install libcurl -y
    yum install libcurl-devel -y
    yum install readline-devel -y
    yum install t1lib-devel -y
    yum install libXpm -y
    yum install libXpm-devel -y
    yum install freetype -y
    yum install freetype-devel -y
    

     

    3.解包并编译

    tar -xf php-5.5.33.tar.gz && cd php-5.5.33
    
    ./configure 
    --prefix=/usr/local/php55 
    --with-mysql=/usr/local/mysql 
    --with-openssl 
    --with-mysqli=/usr/local/mysql/bin/mysql_config 
    --enable-mbstring 
    --with-gd 
    --with-freetype-dir 
    --with-jpeg-dir 
    --with-png-dir 
    --with-zlib 
    --with-xpm-dir 
    --with-t1lib 
    --enable-gd-native-ttf 
    --enable-gd-jis-conv 
    --with-libxml-dir=/usr 
    --enable-xml 
    --enable-sockets 
    --with-mcrypt 
    --with-config-file-path=/usr/local/php55/etc 
    --with-config-file-scan-dir=/usr/local/php55/etc/php.d 
    --with-bz2 
    --with-mysql=mysqlnd 
    --with-mysqli=mysqlnd 
    --with-pdo-mysql=mysqlnd 
    --with-mhash 
    --enable-zip 
    --enable-ftp 
    --with-curl 
    --enable-pcntl 
    --enable-shmop 
    --enable-sysvmsg 
    --enable-sysvsem 
    --enable-sysvshm 
    --enable-bcmath 
    --enable-soap 
    --with-iconv 
    --enable-inline-optimization 
    --with-gettext 
    --enable-shared 
    --enable-opcache 
    --enable-maintainer-zts 
    --with-apxs2=/usr/local/httpd/bin/apxs 
    --with-readline

    2.png

    预处理完成是下面这个样子

    3.png

    然后我们就可以 make && make install 了

    4.png

    过程会比较漫长,请耐心等待...

    编译安装完成:

    5.png

    4.收尾工作

    cp php.ini-production /usr/local/php55/etc/php.ini
    echo 'export PATH=$PATH:/usr/local/php55/bin' >> /etc/profile.d/php.sh

    6.png

     

    配置Apache支持php

    vim /etc/httpd/httpd.conf

    7.png

    8.png

     

    配置php.ini

    vim /usr/local/php55/etc/php.ini

    9.png

    10.png

    11.png

    12.png

     

    5.编辑测试php文件,重启Apache测试

    vim /usr/local/httpd/htdocs/index.php
    
    <?php
        phpinfo();
    ?>

    13.png

    service httpd restart

    14.png

    到此,php编译安装成功。

    我心里一直有个梦,想去嵩山少林学武功... QQ:1976883731
  • 相关阅读:
    【洛谷6776】[NOI2020] 超现实树(思维)
    【洛谷6773】[NOI2020] 命运(线段树合并优化DP)
    【洛谷5467】[PKUSC2018] PKUSC(计算几何)
    【洛谷3688】[ZJOI2017] 树状数组(二维线段树)
    【BZOJ4543】[POI2014] Hotel加强版(长链剖分优化DP)
    【洛谷5466】[PKUSC2018] 神仙的游戏(FFT)
    【BZOJ4574】[ZJOI2016] 线段树(动态规划)
    【洛谷7114】[NOIP2020] 字符串匹配(Z函数)
    扩展 KMP(Z 函数)学习笔记
    最后的胡言乱语
  • 原文地址:https://www.cnblogs.com/xiaofengchu/p/8413278.html
Copyright © 2011-2022 走看看