元の PHP (5.5.20) に影響を与えずに、新しいバージョンの PHP をインストールします。

WBOY
リリース: 2016-06-20 12:51:38
オリジナル
943 人が閲覧しました
  • インストール依存パケット。 sqlite-devel libmemcached libmemcached-devel gcc-c++ unixODBC-devel pcre-devel gmp gmp-devel libxslt-devel libjpeg-turbo-devel freetype-devel -y


  • ダウンロードphpソースコード包
  • wget http://cn2.php.net/distributions/php-5.5.20.tar.gz


  • 编译php源码包
  • Shell#cd /usr/local/src
  • Shell#wget http://cn2.php.net/distributions/php-5.5.20。 tar.gz

    Shell#tar -zxvf php-5.5.20.tar.gz

    Shell#cd php-5.5.20

    Shell#./configure -- prefix=/usr/local/php5520 --with-config-file-path=/usr/local/php5520/etc --with-config-file-scan-dir=/usr/local/php5520/etc/php.d --with-libdir=lib64 --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 -with-freetype-dir=/usr --with-png-dir= /usr --with-xpm-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-gmp --with-iconv --with-jpeg-dir=/ usr --with-openssl --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-sockets --enable-sysvsem -- Enable-sysvshm --enable-sysvmsg --with-kerberos --enable-shmop --enable-calendar --enable-xml --without-mysql --without-gd --disable-dom --disable-dba -- without-unixODBC --disable-pdo --disable-xmlreader --disable-xmlwriter --without-sqlite3 --disable-phar --disable-fileinfo --disable-json --without-pspell --disable-wddx -- without-curl --disable-posix --disable-sysvmsg --disable-sysvshm --disable-sysvsem --enable-fpm --with-mysql=shared,mysqlnd --enable-opcache

    シェル# make && make install


    4. 外部モモ块(他のモモ块按照このモードインストール)

    Shell#cd /usr/local/src/php-5.5.20/ext/bcmath

    Shell#/usr/local/php5520 /bin/phpize

    Shell#./configure --with-php-config=/usr/local/php5520/bin/php-config

    Shell#make (这一步能够看见生成)的bcmath.so的経路)

    Shell#make install

    Shell#vim /usr/local/php5520/etc/php.d/bcmath.ini

    ## ########追加

    extension=bcmath.so

    ##########


    Shell#cd /usr/local/src/php-5.5.20/ext/gd

    Shell#/usr/local/php5520/bin/phpize

    Shell#./configure --with-php-config=/usr/local/php5520/bin/php-config --with-freetype-dir=/usr/ --with-jpeg-dir=/usr/

    Shell#make && make install

    Shell#vim /usr/local/php5520/etc/php.d/gd.ini

    ##########追加

    extension=gd.so

    ##########


    Shell#rpm -ivh ftp: //rpmfind.net/linux/epel/6/x86_64/libmcrypt-2.5.8-9.el6.x86_64.rpm

    Shell#rpm -ivh ftp://rpmfind.net/linux/epel/ 6/x86_64/libmcrypt-devel-2.5.8-9.el6.x86_64.rpm

    Shell#cd /usr/local/src/php-5.5.20/ext/mcrypt

    Shell#/usr/local/php5520/bin/phpize

    Shell#./configure --with-php-config=/usr/local/php5520/bin/php-config

    シェル#make && make install

    Shell#vim /usr/local/php5520/etc/php.d/mcrypt.ini

    ##########追加

    extension=mcrypt.so

    ##########


    #php的缓存模块,对パフォーマンス向上比较大

    Shell#cd /usr/local/src/php-5.5.20/ext/opcache

    Shell#/usr/local/php5520/bin/phpize

    シェル#./configure --with-php-config=/usr/local/php5520/bin/php-config

    Shell#make && make install

    Shell#vim /usr/local/ php5520/etc/php.d/opcache.ini

    ########## 追加

    zend_extension=opcache.so

    opcache.fast_shutdown=1

    opcache.enable_cli=1

    opcache.enable=on

    opcache.memory_consumption=128

    opcache.interned_strings_buffer=8

    opcache.max_accelerated_files=4000

    opcache.revalidate_freq=30

    ##########



    5. 構成php-fpm

    コピーphp-fpmの操作文

    Shell#cp -a /usr/local/src/php-5.5.20/sapi/fpm/init.d. php-fpm /etc/rc.d/init.d/php-fpm

    Shell#chmod +x /etc/rc.d/init.d/php-fpm

    Shell# /etc/init.d/php-fpm start


    6.

    インストール後、php と php-fpm の配置ファイルは /usr/local/php5520/etc の下にあります。

    ソース:php.cn
    このウェブサイトの声明
    この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。
    最新の問題
    人気のチュートリアル
    詳細>
    最新のダウンロード
    詳細>
    ウェブエフェクト
    公式サイト
    サイト素材
    フロントエンドテンプレート
    私たちについて 免責事項 Sitemap
    PHP中国語ウェブサイト:福祉オンライン PHP トレーニング,PHP 学習者の迅速な成長を支援します!