zoukankan      html  css  js  c++  java
  • ubuntu 使用apt-get install 安装php5.6--php7

    使用ppa增加源:
    $ sudo apt-get install python-software-properties $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update $ sudo apt-get install -y php7.0 php7.0-mysql php7.0-curl php7.0-json php7.0-cgi

    然后可以查看php版本:
    php -v

    关于php5.4--php5.6版本
    $ sudo apt-get install python-software-properties
    $ sudo add-apt-repository ppa:ondrej/php
    $ sudo apt-get update
    $ sudo apt-get -y install php5.6 php5.6-mcrypt php5.6-mbstring php5.6-curl php5.6-cli php5.6-mysql php5.6-gd php5.6-intl php5.6-xsl php5.6-zip

    查看php7的扩展
    sudo apt-cache search php7-* 

    或者可以源码安装
    1.下载php7的源码包
    2.tar -zxvf 解压
    3.安装一些依赖
    sudo apt-get install php5-mcrypt libmcrypt-dev
    sudo apt-get install libxslt-dev libxml2-dev

    4./configure --prefix=/zhou.data/php/php7 --enable-maintainer-zts -with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-mhash --with-openssl --with-zlib --with-bz2 --with-curl --with-zlib --enable-mbstring --with-mcrypt --enable-sockets --with-xsl --enable-zip --with-pear --enable-session --enable-xml --enable-shared --enable-bcmath --enable-sysvmsg --enable-sysvsem --enable-sysvshm --enable-mbregex --enable-pcntl --with-xmlrpc
    5.make && make install
    6.如果报错,缺少哪些依赖,就一次安装即可
  • 相关阅读:
    CodeForces 785D Anton and School
    CodeForces 785C Anton and Fairy Tale
    CodeForces 785B Anton and Classes
    CodeForces 785A Anton and Polyhedrons
    爱奇艺全国高校算法大赛初赛C
    爱奇艺全国高校算法大赛初赛B
    爱奇艺全国高校算法大赛初赛A
    EOJ 3265 七巧板
    EOJ 3256 拼音魔法
    EOJ 3262 黑心啤酒厂
  • 原文地址:https://www.cnblogs.com/tirmer/p/8628273.html
Copyright © 2011-2022 走看看