{"id":457,"date":"2016-09-16T15:29:16","date_gmt":"2016-09-16T15:29:16","guid":{"rendered":"http:\/\/myprojects.advchaweb.com\/?p=457"},"modified":"2019-01-19T03:53:41","modified_gmt":"2019-01-19T03:53:41","slug":"update-ppa-for-php","status":"publish","type":"post","link":"https:\/\/myprojects.advchaweb.com\/index.php\/2016\/09\/16\/update-ppa-for-php\/","title":{"rendered":"Update PPA For PHP, Change PHP CLI Version"},"content":{"rendered":"<p><span style=\"background-color: #ffff99; color: #ff0000;\">BEWARE! THIS WOULD MAKE YOUR LOCALHOST NOT WORKING LIKE WEB APP, PHPMYADMIN, ETC. NEED TO BACKUP YOUR DATA FIRST! <\/span><\/p>\n<p>I need to update the PPA for php from ppa:ondrej\/php5-5.6 to ppa:ondrej\/php because the earlier ppa already <a href=\"https:\/\/launchpad.net\/~ondrej\/+archive\/ubuntu\/php5-5.6\" target=\"_blank\" rel=\"noopener noreferrer\">deprecated<\/a>. Here is the step for\u00a0<a href=\"https:\/\/github.com\/oerdnj\/deb.sury.org\/wiki\/PPA-migration-to-ppa:ondrej-php\" target=\"_blank\" rel=\"noopener noreferrer\">PPA migration to ppa:ondrej php<\/a>.<!--more--><\/p>\n<ol>\n<li>Add the new repository ppa:ondrej\/php\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~$ sudo add-apt-repository ppa:ondrej\/php\r\n[sudo] password for teddy: \r\n Co-installable PHP versions: PHP 5.5, 5.6, PHP 7.0 and batteries included.\r\n\r\nYou can get more information about the packages at https:\/\/deb.sury.org\r\n\r\nFor PHP 5.4 on Ubuntu 12.04 use: ppa:ondrej\/php5-oldstable\r\n\r\nBUGS&amp;FEATURES: This PPA now has a issue tracker: https:\/\/deb.sury.org\/#bug-reporting\r\n\r\nPLEASE READ: If you like my work and want to give me a little motivation, please consider donating regularly: https:\/\/donate.sury.org\/\r\n\r\nWARNING: add-apt-repository is broken with non-UTF-8 locales, see https:\/\/github.com\/oerdnj\/deb.sury.org\/issues\/56 for workaround:\r\n\r\n# LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/php\r\n More info: https:\/\/launchpad.net\/~ondrej\/+archive\/ubuntu\/php\r\nPress [ENTER] to continue or ctrl-c to cancel adding it\r\n\r\ngpg: keyring `\/tmp\/tmpn91i_14e\/secring.gpg' created\r\ngpg: keyring `\/tmp\/tmpn91i_14e\/pubring.gpg' created\r\ngpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com\r\ngpg: \/tmp\/tmpn91i_14e\/trustdb.gpg: trustdb created\r\ngpg: key E5267A6C: public key \"Launchpad PPA for Ond\u0159ej Sur\u00fd\" imported\r\ngpg: Total number processed: 1\r\ngpg:               imported: 1  (RSA: 1)\r\nOK<\/pre>\n<\/li>\n<li>Update the system\n<pre class=\"lang:default decode:true \">sudo apt-get update<\/pre>\n<\/li>\n<li>You need to install new libapache2-mod-phpX.Y packages and then disable the old php5, and enable new versioned module, f.e. for PHP 5.6:\n<pre class=\"lang:default decode:true \">sudo apt-get install libapache2-mod-php5.6<\/pre>\n<p>The result:<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~$ sudo apt-get install libapache2-mod-php5.6\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following packages were automatically installed and are no longer required:\r\n  acpi gir1.2-gstreamer-0.10 gnome-desktop-data gnumeric-common gnumeric-doc\r\n  libantlr-java libchamplain-0.12-0 libchamplain-gtk-0.12-0\r\n  libcommons-validator-java libdoxia-sitetools-java libepoxy0 libevdev2\r\n  libgegl-0.2-0 libgoffice-0.10-10-common libhdb9-heimdal libjdependency-java\r\n  libjtidy-java libkdc2-heimdal libmaven-archiver-java\r\n  libmaven-clean-plugin-java libmaven-compiler-plugin-java\r\n  libmaven-dependency-tree-java libmaven-filtering-java\r\n  libmaven-install-plugin-java libmaven-jar-plugin-java\r\n  libmaven-plugin-tools-java libmaven-reporting-impl-java\r\n  libmaven-resources-plugin-java libmaven-shade-plugin-java libming1\r\n  libmono-c5-1.1-cil libmonoboehm-2.0-1 libmonoboehm-2.0-dev libntdb1\r\n  libplexus-compiler-java libplexus-digest-java libplexus-velocity-java\r\n  libssl-dev libssl-doc libvncclient0 libvo-aacenc0 libvo-amrwbenc0\r\n  libwerken.xpath-java libx265 libxml-xpathengine-perl libxvmc1\r\n  linux-headers-3.13.0-76 linux-headers-3.13.0-76-generic-tuxonice\r\n  linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic\r\n  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic\r\n  linux-image-3.13.0-76-generic-tuxonice linux-image-3.19.0-25-generic\r\n  linux-image-4.4.0-34-generic linux-image-extra-3.13.0-76-generic-tuxonice\r\n  linux-image-extra-3.19.0-25-generic linux-image-extra-4.4.0-34-generic\r\n  linux-tools-3.13.0-76 linux-tools-3.13.0-76-generic python-dateutil\r\n  python-feedparser python-ntdb python-utidylib qt-faststart remindor-common\r\n  tclx8.4 velocity\r\nUse 'apt-get autoremove' to remove them.\r\nThe following extra packages will be installed:\r\n  php-common php5.6-cli php5.6-common php5.6-json php5.6-opcache\r\n  php5.6-readline\r\nThe following NEW packages will be installed:\r\n  libapache2-mod-php5.6 php-common php5.6-cli php5.6-common php5.6-json\r\n  php5.6-opcache php5.6-readline\r\n0 upgraded, 7 newly installed, 0 to remove and 16 not upgraded.\r\nNeed to get 5.305 kB of archives.\r\nAfter this operation, 15,9 MB of additional disk space will be used.\r\nDo you want to continue? [Y\/n] Y\r\nGet:1 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php-common all 1:44+deb.sury.org~trusty+1 [12,9 kB]\r\nGet:2 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php5.6-common amd64 5.6.25-2+deb.sury.org~trusty+1 [2.737 kB]\r\nGet:3 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php5.6-json amd64 5.6.25-2+deb.sury.org~trusty+1 [17,0 kB]\r\nGet:4 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php5.6-opcache amd64 5.6.25-2+deb.sury.org~trusty+1 [62,2 kB]\r\nGet:5 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php5.6-readline amd64 5.6.25-2+deb.sury.org~trusty+1 [12,6 kB]\r\nGet:6 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php5.6-cli amd64 5.6.25-2+deb.sury.org~trusty+1 [1.255 kB]\r\nGet:7 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main libapache2-mod-php5.6 amd64 5.6.25-2+deb.sury.org~trusty+1 [1.208 kB]\r\nFetched 5.305 kB in 14s (367 kB\/s)                                             \r\nSelecting previously unselected package php-common.\r\n(Reading database ... 1042745 files and directories currently installed.)\r\nPreparing to unpack ...\/php-common_1%3a44+deb.sury.org~trusty+1_all.deb ...\r\nUnpacking php-common (1:44+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php5.6-common.\r\nPreparing to unpack ...\/php5.6-common_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php5.6-common (5.6.25-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php5.6-json.\r\nPreparing to unpack ...\/php5.6-json_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php5.6-json (5.6.25-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php5.6-opcache.\r\nPreparing to unpack ...\/php5.6-opcache_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php5.6-opcache (5.6.25-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php5.6-readline.\r\nPreparing to unpack ...\/php5.6-readline_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php5.6-readline (5.6.25-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php5.6-cli.\r\nPreparing to unpack ...\/php5.6-cli_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php5.6-cli (5.6.25-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package libapache2-mod-php5.6.\r\nPreparing to unpack ...\/libapache2-mod-php5.6_5.6.25-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking libapache2-mod-php5.6 (5.6.25-2+deb.sury.org~trusty+1) ...\r\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\r\nSetting up php-common (1:44+deb.sury.org~trusty+1) ...\r\nSetting up php5.6-common (5.6.25-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/calendar.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/ctype.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/exif.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/fileinfo.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/ftp.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/gettext.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/iconv.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/pdo.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/phar.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/posix.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/shmop.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/sockets.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/sysvmsg.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/sysvsem.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/sysvshm.ini with new version\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/tokenizer.ini with new version\r\nSetting up php5.6-json (5.6.25-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/json.ini with new version\r\nSetting up php5.6-opcache (5.6.25-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/opcache.ini with new version\r\nSetting up php5.6-readline (5.6.25-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.6\/mods-available\/readline.ini with new version\r\nSetting up php5.6-cli (5.6.25-2+deb.sury.org~trusty+1) ...\r\nupdate-alternatives: using \/usr\/bin\/php5.6 to provide \/usr\/bin\/php (php) in auto mode\r\nupdate-alternatives: using \/usr\/bin\/phar5.6 to provide \/usr\/bin\/phar (phar) in auto mode\r\nupdate-alternatives: using \/usr\/bin\/phar.phar5.6 to provide \/usr\/bin\/phar.phar (phar.phar) in auto mode\r\n\r\nCreating config file \/etc\/php\/5.6\/cli\/php.ini with new version\r\nSetting up libapache2-mod-php5.6 (5.6.25-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.6\/apache2\/php.ini with new version\r\nlibapache2-mod-php5.6: php5 module already enabled, not enabling PHP 5.6<\/pre>\n<p>Disable old php5:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo a2dismod php5\r\nModule php5 disabled.\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart<\/pre>\n<p>Enable php5.6 modules:<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~$ sudo a2enmod php5.6\r\nConsidering dependency mpm_prefork for php5.6:\r\nConsidering conflict mpm_event for mpm_prefork:\r\nConsidering conflict mpm_worker for mpm_prefork:\r\nModule mpm_prefork already enabled\r\nConsidering conflict php5 for php5.6:\r\nEnabling module php5.6.\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart<\/pre>\n<p>Restart apache2 service<\/p>\n<pre class=\"lang:default decode:true \">sudo service apache2 restart<\/pre>\n<\/li>\n<li>uninstall old php5 packages (optional)\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~$ sudo apt-get --purge remove php5-common\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following packages were automatically installed and are no longer required:\r\n  acpi dbconfig-common gir1.2-gstreamer-0.10 gnome-desktop-data\r\n  gnumeric-common gnumeric-doc libantlr-java libchamplain-0.12-0\r\n  libchamplain-gtk-0.12-0 libcommons-validator-java libdoxia-sitetools-java\r\n  libepoxy0 libevdev2 libgegl-0.2-0 libgoffice-0.10-10-common libhdb9-heimdal\r\n  libjdependency-java libjs-codemirror libjs-jquery-cookie\r\n  libjs-jquery-event-drag libjs-jquery-metadata libjs-jquery-mousewheel\r\n  libjs-jquery-tablesorter libjs-jquery-ui libjtidy-java libkdc2-heimdal\r\n  libmaven-archiver-java libmaven-clean-plugin-java\r\n  libmaven-compiler-plugin-java libmaven-dependency-tree-java\r\n  libmaven-filtering-java libmaven-install-plugin-java\r\n  libmaven-jar-plugin-java libmaven-plugin-tools-java\r\n  libmaven-reporting-impl-java libmaven-resources-plugin-java\r\n  libmaven-shade-plugin-java libming1 libmono-c5-1.1-cil libmonoboehm-2.0-1\r\n  libmonoboehm-2.0-dev libntdb1 libplexus-compiler-java libplexus-digest-java\r\n  libplexus-velocity-java libqdbm14 librecode0 libssl-dev libssl-doc\r\n  libtidy-0.99-0 libvncclient0 libvo-aacenc0 libvo-amrwbenc0\r\n  libwerken.xpath-java libx265 libxml-xpathengine-perl libxvmc1\r\n  linux-headers-3.13.0-76 linux-headers-3.13.0-76-generic-tuxonice\r\n  linux-headers-3.19.0-25 linux-headers-3.19.0-25-generic\r\n  linux-headers-4.4.0-34 linux-headers-4.4.0-34-generic\r\n  linux-image-3.13.0-76-generic-tuxonice linux-image-3.19.0-25-generic\r\n  linux-image-4.4.0-34-generic linux-image-extra-3.13.0-76-generic-tuxonice\r\n  linux-image-extra-3.19.0-25-generic linux-image-extra-4.4.0-34-generic\r\n  linux-tools-3.13.0-76 linux-tools-3.13.0-76-generic php5-json pslib1\r\n  python-dateutil python-feedparser python-ntdb python-utidylib qt-faststart\r\n  remindor-common tclx8.4 velocity\r\nUse 'apt-get autoremove' to remove them.\r\nThe following extra packages will be installed:\r\n  php-pear php-xml php7.0-common php7.0-xml\r\nThe following packages will be REMOVED:\r\n  libapache2-mod-php5* php-gettext* php5* php5-cli* php5-common* php5-curl*\r\n  php5-gd* php5-imagick* php5-imap* php5-intl* php5-mcrypt* php5-memcache*\r\n  php5-mysql* php5-ps* php5-pspell* php5-readline* php5-recode* php5-sqlite*\r\n  php5-tidy* php5-xmlrpc* php5-xsl* phpmyadmin*\r\nThe following NEW packages will be installed:\r\n  php-xml php7.0-common php7.0-xml\r\nThe following packages will be upgraded:\r\n  php-pear\r\n1 upgraded, 3 newly installed, 22 to remove and 14 not upgraded.\r\nNeed to get 1.265 kB of archives.\r\nAfter this operation, 40,9 MB disk space will be freed.\r\nDo you want to continue? [Y\/n] Y\r\nGet:1 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php7.0-common amd64 7.0.10-2+deb.sury.org~trusty+1 [864 kB]\r\nGet:2 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php7.0-xml amd64 7.0.10-2+deb.sury.org~trusty+1 [113 kB]\r\nGet:3 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php-xml all 1:7.0+44+deb.sury.org~trusty+1 [4.720 B]\r\nGet:4 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main php-pear all 1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2 [283 kB]\r\nFetched 1.265 kB in 14s (89,4 kB\/s)                                            \r\n(Reading database ... 1042873 files and directories currently installed.)\r\nRemoving phpmyadmin (4:4.0.10-1) ...\r\nConf phpmyadmin disabled.\r\napache2_invoke postrm: Disable configuration phpmyadmin\r\n * Reloading Apache httpd web server apache2                                     * \r\n * Reloading Apache httpd web server apache2                                     * \r\nPurging configuration files for phpmyadmin (4:4.0.10-1) ...\r\napache2_invoke postrm: Purging state for phpmyadmin\r\n * Reloading Apache httpd web server apache2                                     * \r\nRemoving php-gettext (1.0.11-1) ...\r\nRemoving php5 (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving libapache2-mod-php5 (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nphp5_invoke prerm: Disable module opcache for apache2 SAPI\r\nphp5_invoke prerm: Disable module imap for apache2 SAPI\r\nphp5_invoke prerm: Disable module tidy for apache2 SAPI\r\nphp5_invoke prerm: Disable module mysqli for apache2 SAPI\r\nphp5_invoke prerm: Disable module pdo_sqlite for apache2 SAPI\r\nphp5_invoke prerm: Disable module xsl for apache2 SAPI\r\nphp5_invoke prerm: Disable module intl for apache2 SAPI\r\nphp5_invoke prerm: Disable module recode for apache2 SAPI\r\nphp5_invoke prerm: Disable module xdebug for apache2 SAPI\r\nphp5_invoke prerm: Disable module mcrypt for apache2 SAPI\r\nphp5_invoke prerm: Disable module xmlrpc for apache2 SAPI\r\nphp5_invoke prerm: Disable module readline for apache2 SAPI\r\nphp5_invoke prerm: Disable module imagick for apache2 SAPI\r\nphp5_invoke prerm: Disable module pspell for apache2 SAPI\r\nphp5_invoke prerm: Disable module curl for apache2 SAPI\r\nphp5_invoke prerm: Disable module sqlite3 for apache2 SAPI\r\nphp5_invoke prerm: Disable module memcache for apache2 SAPI\r\nphp5_invoke prerm: Disable module gd for apache2 SAPI\r\nphp5_invoke prerm: Disable module json for apache2 SAPI\r\nphp5_invoke prerm: Disable module pdo for apache2 SAPI\r\nphp5_invoke prerm: Disable module mysql for apache2 SAPI\r\nphp5_invoke prerm: Disable module pdo_mysql for apache2 SAPI\r\napache2_invoke php5 prerm: No action required\r\nPurging configuration files for libapache2-mod-php5 (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\napache2_invoke postrm: Purging state for php5\r\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\r\nProcessing triggers for doc-base (0.10.5) ...\r\nProcessing 1 removed doc-base file...\r\nProcessing triggers for hicolor-icon-theme (0.13-1) ...\r\nSelecting previously unselected package php7.0-common.\r\n(Reading database ... 1041583 files and directories currently installed.)\r\nPreparing to unpack ...\/php7.0-common_7.0.10-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php7.0-common (7.0.10-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php7.0-xml.\r\nPreparing to unpack ...\/php7.0-xml_7.0.10-2+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking php7.0-xml (7.0.10-2+deb.sury.org~trusty+1) ...\r\nSelecting previously unselected package php-xml.\r\nPreparing to unpack ...\/php-xml_1%3a7.0+44+deb.sury.org~trusty+1_all.deb ...\r\nUnpacking php-xml (1:7.0+44+deb.sury.org~trusty+1) ...\r\nPreparing to unpack ...\/php-pear_1%3a1.10.1+submodules+notgz-8+donate.sury.org~trusty+2_all.deb ...\r\nUnpacking php-pear (1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2) over (5.6.19+dfsg-1+deb.sury.org~trusty+1) ...\r\ndpkg: warning: unable to delete old directory '\/etc\/pear': Directory not empty\r\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\r\nProcessing triggers for doc-base (0.10.5) ...\r\nProcessing 1 removed doc-base file...\r\n(Reading database ... 1041646 files and directories currently installed.)\r\nRemoving php5-readline (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nphp5_invoke prerm: Disable module readline for cli SAPI\r\nPurging configuration files for php5-readline (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-cli (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nphp5_invoke prerm: Disable module opcache for cli SAPI\r\nphp5_invoke prerm: Disable module imap for cli SAPI\r\nphp5_invoke prerm: Disable module tidy for cli SAPI\r\nphp5_invoke prerm: Disable module mysqli for cli SAPI\r\nphp5_invoke prerm: Disable module pdo_sqlite for cli SAPI\r\nphp5_invoke prerm: Disable module xsl for cli SAPI\r\nphp5_invoke prerm: Disable module intl for cli SAPI\r\nphp5_invoke prerm: Disable module recode for cli SAPI\r\nphp5_invoke prerm: Disable module xdebug for cli SAPI\r\nphp5_invoke prerm: Disable module mcrypt for cli SAPI\r\nphp5_invoke prerm: Disable module xmlrpc for cli SAPI\r\nphp5_invoke prerm: Disable module imagick for cli SAPI\r\nphp5_invoke prerm: Disable module pspell for cli SAPI\r\nphp5_invoke prerm: Disable module curl for cli SAPI\r\nphp5_invoke prerm: Disable module sqlite3 for cli SAPI\r\nphp5_invoke prerm: Disable module memcache for cli SAPI\r\nphp5_invoke prerm: Disable module gd for cli SAPI\r\nphp5_invoke prerm: Disable module json for cli SAPI\r\nphp5_invoke prerm: Disable module pdo for cli SAPI\r\nphp5_invoke prerm: Disable module mysql for cli SAPI\r\nphp5_invoke prerm: Disable module pdo_mysql for cli SAPI\r\nPurging configuration files for php5-cli (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\ndpkg: warning: while removing php5-cli, directory '\/etc\/php5\/cli\/conf.d' not empty so not removed\r\nRemoving php5-intl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-intl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-tidy (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-tidy (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-memcache (3.0.8-5+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-memcache (3.0.8-5+deb.sury.org~trusty+1) ...\r\nRemoving php5-ps (1.3.7-1+deb.sury.org~trusty+2) ...\r\nPurging configuration files for php5-ps (1.3.7-1+deb.sury.org~trusty+2) ...\r\nRemoving php5-curl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-curl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-gd (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-gd (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-imagick (3.3.0-1+deb.sury.org~trusty+2) ...\r\nPurging configuration files for php5-imagick (3.3.0-1+deb.sury.org~trusty+2) ...\r\nRemoving php5-imap (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-imap (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-mcrypt (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-mcrypt (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-mysql (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-mysql (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-pspell (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-pspell (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-recode (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-recode (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-sqlite (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-sqlite (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-xmlrpc (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-xmlrpc (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-xsl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-xsl (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nRemoving php5-common (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nPurging configuration files for php5-common (5.6.23+dfsg-1+deprecated+dontuse+deb.sury.org~trusty+1) ...\r\nProcessing triggers for man-db (2.6.7.1-1ubuntu1) ...\r\nSetting up php7.0-common (7.0.10-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/calendar.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/ctype.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/exif.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/fileinfo.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/ftp.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/gettext.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/iconv.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/pdo.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/phar.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/posix.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/shmop.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/sockets.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/sysvmsg.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/sysvsem.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/sysvshm.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/tokenizer.ini with new version\r\nSetting up php7.0-xml (7.0.10-2+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/dom.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/simplexml.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/wddx.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/xml.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/xmlreader.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/xmlwriter.ini with new version\r\n\r\nCreating config file \/etc\/php\/7.0\/mods-available\/xsl.ini with new version\r\nSetting up php-xml (1:7.0+44+deb.sury.org~trusty+1) ...\r\nSetting up php-pear (1:1.10.1+submodules+notgz-8+donate.sury.org~trusty+2) ...<\/pre>\n<p>&nbsp;<\/li>\n<li>add ppa:ondrej\/php5-compat that provide thin layer of compatibility packages that map php5-&lt;foo&gt; to php5.6-&lt;foo&gt; for main php5* packages:\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo add-apt-repository ppa:ondrej\/php5-compat\r\n Add this repository if you want to use new PHP packages from ppa:ondrej\/php, but for dependency reasons you still need old php5* packages.\r\n More info: https:\/\/launchpad.net\/~ondrej\/+archive\/ubuntu\/php5-compat\r\nPress [ENTER] to continue or ctrl-c to cancel adding it\r\n\r\ngpg: keyring `\/tmp\/tmpt0reyehi\/secring.gpg' created\r\ngpg: keyring `\/tmp\/tmpt0reyehi\/pubring.gpg' created\r\ngpg: requesting key E5267A6C from hkp server keyserver.ubuntu.com\r\ngpg: \/tmp\/tmpt0reyehi\/trustdb.gpg: trustdb created\r\ngpg: key E5267A6C: public key \"Launchpad PPA for Ond\u0159ej Sur\u00fd\" imported\r\ngpg: Total number processed: 1\r\ngpg:               imported: 1  (RSA: 1)\r\nOK<\/pre>\n<p>Update:<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get update<\/pre>\n<p>Dist Upgrade:<\/p>\n<pre class=\"lang:default decode:true \">sudo apt-get dist-upgrade<\/pre>\n<p>Check the php5 packages remaining:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ dpkg --get-selections | grep -v deinstall | grep php5\r\nlibapache2-mod-php5.6\t\t\t\tinstall\r\nphp5-json\t\t\t\t\tinstall\r\nphp5-xdebug\t\t\t\t\tinstall\r\nphp5.6-cli\t\t\t\t\tinstall\r\nphp5.6-common\t\t\t\t\tinstall\r\nphp5.6-json\t\t\t\t\tinstall\r\nphp5.6-opcache\t\t\t\t\tinstall\r\nphp5.6-readline\t\t\t\t\tinstall<\/pre>\n<p>Check the new php version:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ php -v\r\nPHP 5.6.25-2+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies\r\n<\/pre>\n<p>&#8216;deprecated&#8217; text is already removed!<\/li>\n<li>Install the php5-* equivalent packages\n<pre class=\"lang:default decode:true\">sudo apt-get install php-gettext php-curl php-gd php-imagick php-imap php-intl php-mcrypt php-memcache php-mysql php-pspell php-readline php-recode php-tidy php-xmlrpc php-xsl php-mbstring phpmyadmin<\/pre>\n<p>For phpmyadmin installation steps, please follow it <a href=\"http:\/\/myprojects.advchaweb.com\/index.php\/2016\/08\/24\/my-ubuntu-14-04-and-apps-installation-error-and-solution\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>. I found a few packages can&#8217;t be installed like\u00a0php-ps,\u00a0php-sqlite and\u00a0php-xsl<\/p>\n<pre class=\"lang:default decode:true\">E: Unable to locate package php-ps\r\nE: Unable to locate package php-sqlite\r\nE: Package 'php-xsl' has no installation candidate<\/pre>\n<p>That is not OVER YET!\u00a0phpmyadmin DON&#8217;T WORK. When I open it on my browser:\u00a0http:\/\/localhost\/phpmyadmin\/index.php, I got this error:<\/p>\n<pre class=\"lang:default decode:true\">phpMyAdmin - Error\r\nThe mbstring extension is missing. Please check your PHP configuration.<\/pre>\n<p>NEED TO FIND THE SOLUTION HERE!<br \/>\nI followed this <a href=\"http:\/\/askubuntu.com\/questions\/772397\/mbstring-is-missing-for-phpmyadmin-in-ubuntu-16-04\" target=\"_blank\" rel=\"noopener noreferrer\">askubuntu<\/a> but the error still persist! When I did<\/p>\n<pre class=\"lang:default decode:true\">sudo phpenmod mbstring<\/pre>\n<p>I got the another error:<\/p>\n<pre class=\"lang:default decode:true\">WARNING: Module mbstring ini file doesn't exist under \/etc\/php\/5.6\/mods-available<\/pre>\n<p>I dont find mbstring extension on my php.ini file although I installed repeatedly (also installed\u00a0php7.0-mbstring)<br \/>\nI got a weird php version on my terminal (php cli). On my apache2 webserver (http:\/\/localhost\/info.php), I got PHP Version 5.6.25-2+deb.sury.org~trusty+1. but when I checked on terminal, I got php 7.0<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ php -v\r\nPHP 7.0.10-2+deb.sury.org~trusty+1 (cli) ( NTS )\r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.10-2+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies<\/pre>\n<p><a href=\"http:\/\/askubuntu.com\/questions\/761713\/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04\" target=\"_blank\" rel=\"noopener noreferrer\">Here is the solution to downgrade php cli to version 5.6<\/a>\u00a0<a href=\"http:\/\/askubuntu.com\/questions\/761713\/how-can-i-downgrade-from-php-7-to-php-5-6-on-ubuntu-16-04\" target=\"_blank\" rel=\"noopener noreferrer\">(How can I downgrade from PHP 7 to PHP 5.6 on Ubuntu 16.04?)<\/a>:<\/p>\n<pre class=\"lang:default decode:true  \">teddy@teddy-K43SJ:~$ sudo ln -sfn \/usr\/bin\/php5.6 \/etc\/alternatives\/php\r\nteddy@teddy-K43SJ:~$ php -v\r\nPHP 5.6.25-2+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies<\/pre>\n<p><span style=\"color: #ccffcc; background-color: #993300;\">OK. SOLVED<\/span>!! through this <a href=\"http:\/\/askubuntu.com\/questions\/756181\/installing-php-5-6-on-xenial-16-04\" target=\"_blank\" rel=\"noopener noreferrer\">askubuntu<\/a>\u00a0<a href=\"http:\/\/askubuntu.com\/questions\/756181\/installing-php-5-6-on-xenial-16-04\" target=\"_blank\" rel=\"noopener noreferrer\">(Installing PHP 5.6 on Xenial (16.04))<\/a>, I should install php5.6-mbstring instead of just php-mbstring. Then dont forget to restart apache webserver. Now phpmyadmin is back to work.<\/li>\n<li>Try to use php5.5 (ONLY DO THIS IF I WANT TO TRY AND SHIFT TO DIFFERENT PHP VERSION, IN THIS CASE PHP5.5)<br \/>\nCurrently I used php5.6. (php 5.6.26-1)<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-702\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.6.png\" alt=\"apache2-php5-6\" width=\"981\" height=\"220\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.6.png 981w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.6-300x67.png 300w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.6-768x172.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a>In order to use php5.5, I need to disable the apache2 module for php5.6 first<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~\/Downloads$ sudo a2dismod php5.6\r\n[sudo] password for teddy: \r\nModule php5.6 disabled.\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart<\/pre>\n<p>Then restart apache<\/p>\n<pre class=\"lang:default decode:true \">sudo service apache2 restart<\/pre>\n<p>Then enable the php5.5.<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~\/Downloads$ sudo a2enmod php5.5\r\nERROR: Module php5.5 does not exist!<\/pre>\n<p>Here I got an error &#8220;Module php5.5 does not exist!&#8221; because I haven&#8217;t install the apache2 module for php5.5. Install the module<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~\/Downloads$ sudo apt-get install libapache2-mod-php5.5\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nThe following packages were automatically installed and are no longer required:\r\n  acpi gir1.2-gstreamer-0.10 gnome-desktop-data gnumeric-common gnumeric-doc\r\n  libantlr-java libchamplain-0.12-0 libchamplain-gtk-0.12-0\r\n  libcommons-validator-java libdoxia-sitetools-java libepoxy0 libevdev2\r\n  libgegl-0.2-0 libgoffice-0.10-10-common libhdb9-heimdal libjdependency-java\r\n  libjtidy-java libkdc2-heimdal libmaven-archiver-java\r\n  libmaven-clean-plugin-java libmaven-compiler-plugin-java\r\n  libmaven-dependency-tree-java libmaven-filtering-java\r\n  libmaven-install-plugin-java libmaven-jar-plugin-java\r\n  libmaven-plugin-tools-java libmaven-reporting-impl-java\r\n  libmaven-resources-plugin-java libmaven-shade-plugin-java libming1\r\n  libmono-c5-1.1-cil libntdb1 libplexus-compiler-java libplexus-digest-java\r\n  libplexus-velocity-java libssl-dev libssl-doc libtidy-0.99-0 libvncclient0\r\n  libvo-aacenc0 libvo-amrwbenc0 libwerken.xpath-java libx265\r\n  libxml-xpathengine-perl libxvmc1 linux-headers-3.13.0-76\r\n  linux-headers-3.13.0-76-generic-tuxonice linux-headers-3.19.0-25\r\n  linux-headers-3.19.0-25-generic linux-headers-4.4.0-34\r\n  linux-headers-4.4.0-34-generic linux-image-3.13.0-76-generic-tuxonice\r\n  linux-image-3.19.0-25-generic linux-image-4.4.0-34-generic\r\n  linux-image-extra-3.13.0-76-generic-tuxonice\r\n  linux-image-extra-3.19.0-25-generic linux-image-extra-4.4.0-34-generic\r\n  linux-tools-3.13.0-76 linux-tools-3.13.0-76-generic pslib1 python-dateutil\r\n  python-feedparser python-ntdb python-utidylib qt-faststart remindor-common\r\n  tclx8.4 velocity\r\nUse 'apt-get autoremove' to remove them.\r\nThe following NEW packages will be installed:\r\n  libapache2-mod-php5.5\r\n0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.\r\n1 not fully installed or removed.\r\nNeed to get 1.199 kB of archives.\r\nAfter this operation, 4.424 kB of additional disk space will be used.\r\nGet:1 http:\/\/ppa.launchpad.net\/ondrej\/php\/ubuntu\/ trusty\/main libapache2-mod-php5.5 amd64 5.5.38-3+deb.sury.org~trusty+1 [1.199 kB]\r\nFetched 1.199 kB in 3s (338 kB\/s)                \r\nSelecting previously unselected package libapache2-mod-php5.5.\r\n(Reading database ... 1135829 files and directories currently installed.)\r\nPreparing to unpack ...\/libapache2-mod-php5.5_5.5.38-3+deb.sury.org~trusty+1_amd64.deb ...\r\nUnpacking libapache2-mod-php5.5 (5.5.38-3+deb.sury.org~trusty+1) ...\r\nSetting up libapache2-mod-php5.5 (5.5.38-3+deb.sury.org~trusty+1) ...\r\n\r\nCreating config file \/etc\/php\/5.5\/apache2\/php.ini with new version\r\nphp_invoke: Enable module ctype for apache2 sapi\r\nphp_invoke: Enable module iconv for apache2 sapi\r\nphp_invoke: Enable module opcache for apache2 sapi\r\nphp_invoke: Enable module gettext for apache2 sapi\r\nphp_invoke: Enable module sysvshm for apache2 sapi\r\nphp_invoke: Enable module ftp for apache2 sapi\r\nphp_invoke: Enable module sockets for apache2 sapi\r\nphp_invoke: Enable module posix for apache2 sapi\r\nphp_invoke: Enable module sysvsem for apache2 sapi\r\nphp_invoke: Enable module fileinfo for apache2 sapi\r\nphp_invoke: Enable module readline for apache2 sapi\r\nphp_invoke: Enable module shmop for apache2 sapi\r\nphp_invoke: Enable module memcache for apache2 sapi\r\nphp_invoke: Enable module calendar for apache2 sapi\r\nphp_invoke: Enable module tokenizer for apache2 sapi\r\nphp_invoke: Enable module sysvmsg for apache2 sapi\r\nphp_invoke: Enable module json for apache2 sapi\r\nphp_invoke: Enable module pdo for apache2 sapi\r\nphp_invoke: Enable module exif for apache2 sapi\r\nphp_invoke: Enable module phar for apache2 sapi\r\napache2_invoke: Enable module php5.5\r\n * Restarting Apache httpd web server apache2                                   AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n                                                                         [ OK ]\r\nSetting up php5-mapscript (6.4.1-2) ...\r\n\/var\/lib\/dpkg\/info\/php5-mapscript.postinst: 11: \/var\/lib\/dpkg\/info\/php5-mapscript.postinst: php5enmod: not found\r\ndpkg: error processing package php5-mapscript (--configure):\r\n subprocess installed post-installation script returned error exit status 127\r\nErrors were encountered while processing:\r\n php5-mapscript\r\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)\r\nteddy@teddy-K43SJ:~\/Downloads\/Upworks$ sudo service apache2 restart * Restarting Apache httpd web server apache2                                   AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n                                                                         [ OK ]<\/pre>\n<p>Restart apache! then enable php5.5 module<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~\/Downloads$ sudo a2enmod php5.5\r\nConsidering dependency mpm_prefork for php5.5:\r\nConsidering conflict mpm_event for mpm_prefork:\r\nConsidering conflict mpm_worker for mpm_prefork:\r\nModule mpm_prefork already enabled\r\nConsidering conflict php5 for php5.5:\r\nModule php5.5 already enabled<\/pre>\n<p>When I refreshed the phpinfo, now I&#8217;m using php5.5 (php 5.5.38-3+deb.sury.org~trusty+1)<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-703\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.5.png\" alt=\"apache2-php5-5\" width=\"628\" height=\"285\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.5.png 628w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/apache2-php5.5-300x136.png 300w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 984px) 61vw, (max-width: 1362px) 45vw, 600px\" \/><\/a>I also need to change the php cli on my terminal. It still use php5.6<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Downloads$ php -v\r\nPHP 5.6.26-1+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies<\/pre>\n<p>to shift to another php version, use like this:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Downloads$ sudo ln -sfn \/usr\/bin\/php5.5 \/etc\/alternatives\/php<\/pre>\n<p>Here is my php cli version<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Downloads$ php -v\r\nPHP 5.5.38-3+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2015 The PHP Group\r\nZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies<\/pre>\n<p>I need to install some php modules<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install php-gettext php-curl php-gd php-imagick php-imap php-intl php-mcrypt php-memcache php-mysql php-pspell php-readline php-recode php-tidy php-xmlrpc php5.5-xsl php-mbstring phpmyadmin\r\n<\/pre>\n<p>I use explicitly &#8216;php5.5-xsl&#8217; instead of just &#8216;php-xsl&#8217; or I got this error<\/p>\n<pre class=\"lang:default decode:true \">...\r\nPackage php-xsl is a virtual package provided by:\r\n  php7.1-xml 7.1.0~rc2-1+deb.sury.org~trusty+1\r\n  php5.5-xml 5.5.38-3+deb.sury.org~trusty+1\r\n  php7.0-xml 7.0.11-1+deb.sury.org~trusty+1\r\n  php5.6-xml 5.6.26-1+deb.sury.org~trusty+1\r\nYou should explicitly select one to install.\r\n\r\nE: Package 'php-xsl' has no installation candidate<\/pre>\n<p>A few more packages need to be installed, like mbstring, mysqli and mcrypt to make phpmyadmin working!<\/p>\n<pre class=\"lang:default decode:true\">sudo apt-get install php5.5-mbstring\r\nsudo apt-get install php5.5-mysqli\r\nsudo apt-get install php5.5-mcrypt<\/pre>\n<p>DONT FORGET TO RESTART APACHE THEN<\/p>\n<pre class=\"lang:default decode:true \">sudo service apache2 restart<\/pre>\n<p>TO MOVE BACK TO PHP 5.6, DO THIS<\/p>\n<pre class=\"lang:default decode:true \">sudo a2dismod php5.5\r\nsudo service apache2 restart\r\nsudo a2enmod php5.6\r\nsudo service apache2 restart<\/pre>\n<p>FOR PHP CLI<\/p>\n<pre class=\"lang:default decode:true \">sudo ln -sfn \/usr\/bin\/php5.6 \/etc\/alternatives\/php\r\nphp -v<\/pre>\n<p>I found something useful to use different php version on the linux terminal like this<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~\/Downloads$ php5.6 -v\r\nPHP 5.6.26-1+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies\r\n\r\nteddy@teddy-K43SJ:~\/Downloads$ php5.5 -v\r\nPHP 5.5.38-3+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2015 The PHP Group\r\nZend Engine v2.5.0, Copyright (c) 1998-2015 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies\r\n\r\nteddy@teddy-K43SJ:~\/Downloads\/Upworks$ php -v\r\nPHP 5.6.26-1+deb.sury.org~trusty+1 (cli) \r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies\r\n\r\nteddy@teddy-K43SJ:~\/Downloads$ php7.0 -v\r\nPHP 7.0.11-1+deb.sury.org~trusty+1 (cli) ( NTS )\r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.11-1+deb.sury.org~trusty+1, Copyright (c) 1999-2016, by Zend Technologies<\/pre>\n<p>the default php version now is php5.6 that showed the same result!<br \/>\nDON&#8217;T FORGET TO CONFIGURE PHP SETTING:<br \/>\na. type :<\/p>\n<pre class=\"lang:default decode:true\">sudo gedit \/etc\/php\/5.6\/apache2\/php.ini<\/pre>\n<p>b. edit php setting like :<\/p>\n<pre class=\"lang:default decode:true\">upload_max_filesize = 1000M -&gt; (default 2M)\r\npost_max_size = 1000M -&gt; (default 8M)\r\nmax_execution_time = 600 -&gt; (default 30) in second<\/pre>\n<p>c. restart apache :<\/p>\n<pre class=\"lang:default decode:true\">sudo service apache2 restart<\/pre>\n<p>d. Check the value in http:\/\/localhost\/info.php<\/p>\n<p>It&#8217;d be same if I want to use PHP 7 (php7.0). First deactivate my default php5.6<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo a2dismod php5.6\r\nModule php5.6 disabled.\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart<\/pre>\n<p>Then restart apache2 as recommended<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo service apache2 restart\r\n * Restarting Apache httpd web server apache2                                   AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n                                                                         [ OK ]<\/pre>\n<p>Enable php 7 (here is php7.0)<\/p>\n<pre class=\"lang:default decode:true\">teddy@teddy-K43SJ:~$ sudo a2enmod php7.0 \r\nConsidering dependency mpm_prefork for php7.0:\r\nConsidering conflict mpm_event for mpm_prefork:\r\nConsidering conflict mpm_worker for mpm_prefork:\r\nModule mpm_prefork already enabled\r\nConsidering conflict php5 for php7.0:\r\nEnabling module php7.0.\r\nTo activate the new configuration, you need to run:\r\n  service apache2 restart<\/pre>\n<p>Then restart the apache2 server again<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo service apache2 restart<\/pre>\n<p>Check the current php version in http:\/\/localhost\/info.php<a href=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/php7.0.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-2121\" src=\"http:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/php7.0.png\" alt=\"\" width=\"1012\" height=\"327\" srcset=\"https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/php7.0.png 1012w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/php7.0-300x97.png 300w, https:\/\/myprojects.advchaweb.com\/wp-content\/uploads\/2016\/09\/php7.0-768x248.png 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/a>If I need to install more php7.0 extension like mysqli extension is needed by phpmyadmin, do like this:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install php7.0-mysqli<\/pre>\n<p>don&#8217;t forget to restart apache server!<br \/>\nTo change the PHP setting, pls do like this:<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/php\/7.0\/apache2\/php.ini<\/pre>\n<p>Modify the php.ini file:<\/p>\n<pre class=\"lang:default decode:true \">upload_max_filesize = 1000M -&gt; (default 2M)\r\npost_max_size = 1000M -&gt; (default 8M)\r\nmax_execution_time = 600 -&gt; (default 30) in second<\/pre>\n<p>Then restart apache server!<\/li>\n<li>Install xdebug for php5.6<br \/>\nSomehow I didn&#8217;t find xdebug installed for php 5.6. When I opened http:\/\/localhost\/info.php, I couldn&#8217;t find xdebug. After some tries, I have to install it manually with &#8216;sudo apt-get install php5.6-xdebug&#8217;.<br \/>\nTo write the xdebug setting, No need to write it in &#8216;\/etc\/php\/5.6\/apache2\/php.ini&#8217; but write it in &#8216;\/etc\/php\/5.6\/apache2\/conf.d\/20-xdebug.ini&#8217;.<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/php\/5.6\/apache2\/conf.d\/20-xdebug.ini<\/pre>\n<p>Here is the setting (would use it with kcachegrind):<\/p>\n<pre class=\"lang:default decode:true\">zend_extension=xdebug.so\r\nxdebug.remote_autostart=0\r\nxdebug.remote_enable=0\r\nxdebug.profiler_enable=0\r\nxdebug.max_nesting_level=250\r\nxdebug.profiler_enable_trigger=1\r\nxdebug.profiler_output_dir=\"\/media\/data\/MASTER\/php\/cachegrind\"\r\nxdebug.profiler_output_name = \"cachegrind.out.%p\"<\/pre>\n<p>Dont forget to restart apache after writing the setting.<br \/>\nThe setting means I can only use xdebug with a trigger like this: http:\/\/localhost\/works\/thefootnotes\/?XDEBUG_PROFILE=1<br \/>\nThe xdebug output would be written in &#8216;\/media\/data\/MASTER\/php\/cachegrind\/&#8217; directory. Use KCacheGrind to view the output<\/li>\n<li>Next time if I want to use and install php 7 along side php 5.6, I can read these tutorials:<br \/>\n<a href=\"http:\/\/lornajane.net\/posts\/2016\/php-7-0-and-5-6-on-ubuntu\" target=\"_blank\" rel=\"noopener noreferrer\">PHP 7.0 (and 5.6) on Ubuntu<\/a><br \/>\n<a href=\"https:\/\/www.23systems.net\/2016\/01\/installing-php-5-6-x-7-0-x-ubuntu-14-04-virtualmin-5-0gpl-using-ppa\/\" target=\"_blank\" rel=\"noopener noreferrer\">Installing PHP 5.6.x and 7.0.x with Ubuntu 14.04 and Virtualmin 5.0gpl using a PPA<\/a><\/li>\n<li>SOLUTION FOR THE ERROR\n<pre class=\"lang:default decode:true \">Removing php5-mapscript (6.4.1-2ubuntu0.1) ...\r\n\/var\/lib\/dpkg\/info\/php5-mapscript.prerm: 8: \/var\/lib\/dpkg\/info\/php5-mapscript.prerm: php5dismod: not found\r\ndpkg: error processing package php5-mapscript (--purge):\r\n subprocess installed pre-removal script returned error exit status 127\r\nErrors were encountered while processing:\r\n php5-mapscript\r\nE: Sub-process \/usr\/bin\/dpkg returned an error code (1)\r\nteddy@teddy-K43SJ:~$ sudo apt-get install php5dismod\r\nReading package lists... Done\r\nBuilding dependency tree       \r\nReading state information... Done\r\nE: Unable to locate package php5dismod<\/pre>\n<p>Ref: https:\/\/askubuntu.com\/questions\/723775\/cannot-uninstall-php-memcache-using-terminal<br \/>\nSO remove the files like this then update:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo rm -rf \/var\/lib\/dpkg\/info\/php5-mapscript.postinst \r\nteddy@teddy-K43SJ:~$ sudo rm -rf \/var\/lib\/dpkg\/info\/php5-mapscript.prerm\r\nteddy@teddy-K43SJ:~$ sudo apt-get update<\/pre>\n<p>&nbsp;<\/li>\n<li>Install PHP 7.1 and enable it:\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install libapache2-mod-php7.1\r\nteddy@teddy-K43SJ:~$ sudo a2enmod php7.1<\/pre>\n<p>Check the current php version on the teminal:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ php -v\r\nPHP 7.1.6-2~ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jun 14 2017 05:58:40) ( NTS )\r\nCopyright (c) 1997-2017 The PHP Group\r\nZend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies\r\n    with Zend OPcache v7.1.6-2~ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies\r\n    with Xdebug v2.5.4, Copyright (c) 2002-2017, by Derick Rethans<\/pre>\n<p>BUT I GOT A FAIL WHEN TRYING TO RESTART APACHE2 SERVICE:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo service apache2 restart\r\n * Restarting Apache httpd web server apache2                                   [Thu Jun 15 21:57:23.850941 2017] [so:warn] [pid 18832] AH01574: module php7_module is already loaded, skipping\r\nAH00112: Warning: DocumentRoot [\/home\/teddy\/Documents\/works\/symfony\/myproj\/web] does not exist\r\nAH00112: Warning: DocumentRoot [\/home\/teddy\/Documents\/works\/theflyingfork] does not exist\r\nAH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message\r\n(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80\r\n(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80\r\nno listening sockets available, shutting down\r\nAH00015: Unable to open logs\r\nAction 'start' failed.\r\nThe Apache error log may have more information.\r\n                                                                         [fail]<\/pre>\n<p>SOLUTION: I NEED TO STOP NGINX SERVICE FIRST:<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo service nginx stop<\/pre>\n<p>ALSO CHECK THE PHP VERSION ON THE BROWSER: http:\/\/localhost\/info.php.<br \/>\nI also need to install a few php7.1 extension needed like zip extension (ref: <a href=\"https:\/\/laracasts.com\/discuss\/channels\/laravel\/zip-php-extension-problem-in-ubuntu-php7\">https:\/\/laracasts.com\/discuss\/channels\/laravel\/zip-php-extension-problem-in-ubuntu-php7<\/a>):<\/p>\n<pre class=\"lang:default decode:true \">teddy@teddy-K43SJ:~$ sudo apt-get install php7.1-zip<\/pre>\n<p>DON&#8217;T FORGET TO CONFIGURE PHP SETTING:<br \/>\na. type :<\/p>\n<pre class=\"lang:default decode:true \">sudo gedit \/etc\/php\/7.1\/apache2\/php.ini<\/pre>\n<p>b. edit php setting like :<\/p>\n<pre class=\"lang:default decode:true \">upload_max_filesize = 2000M -&gt; (default 2M)\r\npost_max_size = 2560M -&gt; (default 8M)\r\nmax_execution_time = 600 -&gt; (default 30) in second\r\nmemory_limit = 2560M -&gt; (default 128M)<\/pre>\n<p>c. restart apache :<\/p>\n<pre class=\"lang:default decode:true\">sudo service apache2 restart<\/pre>\n<p>d. Check the value in http:\/\/localhost\/info.php<\/p>\n<p>&nbsp;<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>BEWARE! THIS WOULD MAKE YOUR LOCALHOST NOT WORKING LIKE WEB APP, PHPMYADMIN, ETC. NEED TO BACKUP YOUR DATA FIRST! I need to update the PPA for php from ppa:ondrej\/php5-5.6 to ppa:ondrej\/php because the earlier ppa already deprecated. Here is the step for\u00a0PPA migration to ppa:ondrej php.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,48],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-php","category-php-2"],"_links":{"self":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":26,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":9112,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/posts\/457\/revisions\/9112"}],"wp:attachment":[{"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/myprojects.advchaweb.com\/index.php\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}