{"id":482,"date":"2019-03-12T11:18:04","date_gmt":"2019-03-12T03:18:04","guid":{"rendered":"https:\/\/play.datalude.com\/blog\/?p=482"},"modified":"2019-10-09T12:33:56","modified_gmt":"2019-10-09T04:33:56","slug":"quick-notes-upgrade-php-7-0-eol-to-php-7-3-on-vestacp-running-on-ubuntu-16-04","status":"publish","type":"post","link":"https:\/\/play.datalude.com\/blog\/2019\/03\/quick-notes-upgrade-php-7-0-eol-to-php-7-3-on-vestacp-running-on-ubuntu-16-04\/","title":{"rendered":"Quick notes: Upgrade PHP 7.0 (EOL) to PHP 7.3 on VestaCP running on Ubuntu 16.04"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Do this. <br><br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Take a record (optional)\ndpkg --get-selections | grep -i php > prephp.txt\nphp -m >> prephp.txt \n\n# Do the upgrade\napt install software-properties-common python-software-properties\nLC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/php\nLC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/apache2\napt update\napt install libapache2-mod-php7.3 php7.3 php7.3-cgi php7.3-cli php7.3-common php7.3-curl php7.3-gd php7.3-imap php7.3-intl php7.3-json php7.3-ldap php7.3-mbstring php7.3-mysql php7.3-opcache php7.3-pspell php7.3-readline php7.3-soap php7.3-xml \nphp --version\n\n# Fix apache\na2dismod php7.0 \na2enmod php7.3\nsystemctl restart apache2\n\n# What changed (optional)\ndpkg --get-selections | grep -i php > postphp.txt\nphp -m >> postphp.txt \ndiff prephp.txt postphp.txt <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That's all &#8230; just seem to have been doing this a lot recently, so I thought I'd write it down somewhere. Odd that PHP 7.0 is end of life, yet its the only PHP officially running on Ubuntu 16. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This proved to be a useful command for generating lists of packages to install.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>dpkg --get-selections | grep php | grep -v deinstall | grep install | awk '{print $1}' | tr '\\n' ' '<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">And I guess this might have been better:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dpkg --get-selections | grep php | grep -v deinstall | grep php7.0 | awk '{print $1}' | tr '\\n' ' ' | sed 's\/php7.0\/php7.3\/g'<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">And for Ubuntu 18.04 &#8230; <\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Ubuntu 18.04 comes with php7.2 anyway, so the process is a bit easier, and the ondrej repository actually does much of the work for you.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># ondrej repo will upgrade 7.2 and install much of 7.3 for you\nLC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/php # and hit ENTER\nLC_ALL=C.UTF-8 add-apt-repository ppa:ondrej\/php #and hit ENTER\napt upgrade\n\n#Fix apache\na2dismod php7.2\na2enmod php7.3\nsystemctl restart apache2\n\n# What PHP 7.2 extensions do we have installed? Install the equivalent PHP 7.3 ones. \ndpkg --get-selections | grep php | grep -v deinstall | grep php7.2 | awk '{print $1}' | tr '\\n' ' ' | sed 's\/php7.2\/php7.3\/g'\napt install {copy and paste list from above}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Do this. That's all &#8230; just seem to have been doing this a lot recently, so I thought I'd write it down somewhere. Odd that PHP 7.0 is end of life, yet its the only PHP officially running on Ubuntu 16. This proved to be a useful command for generating lists of packages to install. &#8230; <a title=\"Quick notes: Upgrade PHP 7.0 (EOL) to PHP 7.3 on VestaCP running on Ubuntu 16.04\" class=\"read-more\" href=\"https:\/\/play.datalude.com\/blog\/2019\/03\/quick-notes-upgrade-php-7-0-eol-to-php-7-3-on-vestacp-running-on-ubuntu-16-04\/\" aria-label=\"Read more about Quick notes: Upgrade PHP 7.0 (EOL) to PHP 7.3 on VestaCP running on Ubuntu 16.04\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[1],"tags":[],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-it"],"_links":{"self":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/comments?post=482"}],"version-history":[{"count":0,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/posts\/482\/revisions"}],"wp:attachment":[{"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/media?parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/categories?post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/play.datalude.com\/blog\/wp-json\/wp\/v2\/tags?post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}