1 頁 (共 1 頁)

16.04 install php 5.6

發表於 : 2016-08-20 09:30:31
yehlu
http://askubuntu.com/questions/756181/i ... nial-16-04

down vote
accepted
Remove all the stock php packages

List installed php packages with dpkg -l | grep php| awk '{print $2}' |tr "\n" " " then remove unneeded packages with sudo aptitude purge your_packages_here or if you want to directly remove them all use :

sudo aptitude purge `dpkg -l | grep php| awk '{print $2}' |tr "\n" " "`
Add the PPA

sudo add-apt-repository ppa:ondrej/php
Install your PHP Version

sudo apt-get update
sudo apt-get install php5.6
You can install php5.6 modules too for example

sudo apt-get install php5.6-mbstring php5.6-mcrypt php5.6-mysql php5.6-xml
Verify your version

sudo php -v