ubuntu 使用apt-get install 安装php5.6--php7
生活随笔
收集整理的這篇文章主要介紹了
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.如果報錯,缺少哪些依賴,就一次安裝即可
$ 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.如果報錯,缺少哪些依賴,就一次安裝即可
轉載于:https://www.cnblogs.com/tirmer/p/8628273.html
總結
以上是生活随笔為你收集整理的ubuntu 使用apt-get install 安装php5.6--php7的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: elasticsearch-6.0.1安
- 下一篇: Java基础知识学习04-自定义类、Ar