Linux學習-11月13日(PHP安裝)

11月13日任務php

11.10/11.11/11.12 安裝PHP5mysql

11.13 安裝PHP7sql

php中mysql,mysqli,mysqlnd,pdo究竟是什麼 http://blog.csdn.net/u013785951/article/details/60876816apache

查看編譯參數  http://ask.apelearn.com/question/1295 socket

 

1、PHP5安裝工具

一、PHP介紹性能

  • PHP官網:www.php.net
  • 目前主流版本爲5.6或7.1版本

            如今大部分企業都使用的是PHP5版本,PHP7是近幾年纔出的新版本,改動比較大,有些老的程序在PHP7中使用會出現問題,因此不少企業都還在使用PHP5。PHP7性能提高比較大,若果程序能夠兼容PHP7那就使用PHP7.net

  •  把PHP放在最後安裝,是由於先要安裝好Apache,安裝好以後指定apxs2,不然沒法自動安裝它的模塊

二、PHP安裝xml

  • 下載安裝包

        cd /usr/local/srcblog

        wget http://cn2.php.net/distributions/php-5.6.30.tar.gz

  • 編譯

        tar -xvf php-5.6.30.tar.gz

        cd php-5.6.30     

./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2.4/bin/apxs --with-config-file-path=/usr/local/php/etc --with-mysql=/usr/local/mysql --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif

    編譯參數解釋:

    --prefix=/usr/local/php   :安裝目錄

   --with-apxs2=/usr/local/apache2.4/bin/apxs   :指定apxs,它是apache的一個工具,它能夠自動的幫你去把擴展的模塊放到Apache中的modules目錄裏,而且在它的配置文件里加上一行load module。

     --with-config-file-path=/usr/local/php/etc :指定配置文件路徑

    --with-mysql=/usr/local/mysql   :指定mysql的路徑

    --with-pdo-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config  :  mysql的驅動

    --with-libxml-dir --with-gd --with-jpeg-dir --with-png-dir --with-freetype-dir --with-iconv-dir --with-zlib-dir --with-bz2 --with-openssl --with-mcrypt --enable-soap --enable-gd-native-ttf --enable-mbstring --enable-sockets --enable-exif  : 通用參數,沒有特殊要求就默認便可

  • 安裝缺乏的包    

    yum install openssl openssl-devel

    yum install bzip2-devel.x86_64

    yum install libpng-devel

    yum -y install libjpeg-devel

    yum install freetype-devel

    yum install -y epel-release

    yum install -y libmcrypt-devel

    yum -y install ncurses-devel

 

  • 安裝

    make && make install

相關文章
相關標籤/搜索