版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/austindev/article/details/65629922
PHP7 TO PHP5.6
remove PHP installed
- List the installed php pkg
root@VM-13-184-ubuntu:~# dpkg -l | grep php7
ii libapache2-mod-php7.0 7.0.13-0ubuntu0.16.04.1 amd64 server-side, HTML-embedded scripting language (Apache 2 module)
ii php7.0 7.0.13-0ubuntu0.16.04.1 all server-side, HTML-embedded scripting language (metapackage)
ii php7.0-cli 7.0.13-0ubuntu0.16.04.1 amd64 command-line interpreter for the PHP scripting language
ii php7.0-common 7.0.13-0ubuntu0.16.04.1 amd64 documentation, examples and common module for PHP
ii php7.0-curl 7.0.13-0ubuntu0.16.04.1 amd64 CURL module for PHP
ii php7.0-gd 7.0.13-0ubuntu0.16.04.1 amd64 GD module for PHP
ii php7.0-imap 7.0.13-0ubuntu0.16.04.1 amd64 IMAP module for PHP
ii php7.0-intl 7.0.13-0ubuntu0.16.04.1 amd64 Internationalisation module for PHP
ii php7.0-json 7.0.13-0ubuntu0.16.04.1 amd64 JSON module for PHP
ii php7.0-mbstring 7.0.13-0ubuntu0.16.04.1 amd64 MBSTRING module for PHP
ii php7.0-mcrypt 7.0.13-0ubuntu0.16.04.1 amd64 libmcrypt module for PHP
ii php7.0-mysql 7.0.13-0ubuntu0.16.04.1 amd64 MySQL module for PHP
ii php7.0-opcache 7.0.13-0ubuntu0.16.04.1 amd64 Zend OpCache module for PHP
ii php7.0-pspell 7.0.13-0ubuntu0.16.04.1 amd64 pspell module for PHP
ii php7.0-readline 7.0.13-0ubuntu0.16.04.1 amd64 readline module for PHP
ii php7.0-recode 7.0.13-0ubuntu0.16.04.1 amd64 recode module for PHP
ii php7.0-sqlite3 7.0.13-0ubuntu0.16.04.1 amd64 SQLite3 module for PHP
ii php7.0-tidy 7.0.13-0ubuntu0.16.04.1 amd64 tidy module for PHP
ii php7.0-xml 7.0.13-0ubuntu0.16.04.1 amd64 DOM, SimpleXML, WDDX, XML, and XSL module for PHP
ii php7.0-xmlrpc 7.0.13-0ubuntu0.16.04.1 amd64 XMLRPC-EPI module for PHP
ii php7.0-xsl 7.0.13-0ubuntu0.16.04.1 all XSL module for PHP (dummy)
- remove the installed php pkg
dpkg -l | grep php7 | awk '{print $2}' | tr "\n" " "
sudo aptitude purge `dpkg -l | grep php7| awk '{print $2}' |tr "\n" " "`
- the remove error
mysql_upgrade: Got error: 1045: Access denied for user ‘root’@’localhost’ (using password: NO) while connecting to the MySQL server
修改MySQL root用户密码
mysqladmin command to change root password
$ mysqladmin -u root password NEWPASSWORD
root@VM-13-184-ubuntu:~# mysqladmin -u root -p'oldpassword' password'newpassword'
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
New password:
Confirm new password:
Warning: Since password will be sent to server in plain text, use ssl connection to ensure password safety.
update user set password=PASSWORD(“”) where User=’root’
安装php5.6
apt-get install php5.6 libapache2-mod-php5.6
apt-get -y install php5.6-mysql php5.6-curl php5.6-gd php5.6-intl php-pear php-imagick php5.6-imap php5.6-mcrypt php-memcache php5.6-pspell php5.6-recode php5.6-sqlite3 php5.6-tidy php5.6-xmlrpc php5.6-xsl php5.6-mbstring php-gettext