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
  • 相关阅读:
    vs2005+Access开发网站管理系统日志2
    第三方控件安装方法
    elphi编写dll
    DELPHI IDE中部分操作快捷方式
    Delphi制作DLL
    delphi快捷键大全
    dll窗体的创建与调用
    delphi中dll综合运用的例子(动态加载插件)
    DELPHI中MessageBox的用法
    Office2010从第三页开始设置页码
  • 原文地址:https://www.cnblogs.com/xiaofengchu/p/8413278.html
Copyright © 2011-2022 走看看