Upgrade to the latest PHP version in ubuntu 16.04
I am using NextCloud in my server and NextCloud informs me that:
You are currently running PHP
7.0.32-0ubuntu0.16.04.1. Upgrade your
PHP version to take advantage of performance and security updates
provided by the PHP Group as soon as your distribution supports it.
So, I tried to upgrade me OS (Ubuntu 16.04), by executing:
apt-get update
apt-get dist-update
Then I restarted the server and I re-executed the above commands. After all these, when I connect from terminal I am getting:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-83-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
and my PHP version is still PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS ).
This means that PHP 7.0.32 is the latest possible version that I can install in ubuntu 16.04;
16.04 upgrade php nextcloud
add a comment |
I am using NextCloud in my server and NextCloud informs me that:
You are currently running PHP
7.0.32-0ubuntu0.16.04.1. Upgrade your
PHP version to take advantage of performance and security updates
provided by the PHP Group as soon as your distribution supports it.
So, I tried to upgrade me OS (Ubuntu 16.04), by executing:
apt-get update
apt-get dist-update
Then I restarted the server and I re-executed the above commands. After all these, when I connect from terminal I am getting:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-83-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
and my PHP version is still PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS ).
This means that PHP 7.0.32 is the latest possible version that I can install in ubuntu 16.04;
16.04 upgrade php nextcloud
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26
add a comment |
I am using NextCloud in my server and NextCloud informs me that:
You are currently running PHP
7.0.32-0ubuntu0.16.04.1. Upgrade your
PHP version to take advantage of performance and security updates
provided by the PHP Group as soon as your distribution supports it.
So, I tried to upgrade me OS (Ubuntu 16.04), by executing:
apt-get update
apt-get dist-update
Then I restarted the server and I re-executed the above commands. After all these, when I connect from terminal I am getting:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-83-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
and my PHP version is still PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS ).
This means that PHP 7.0.32 is the latest possible version that I can install in ubuntu 16.04;
16.04 upgrade php nextcloud
I am using NextCloud in my server and NextCloud informs me that:
You are currently running PHP
7.0.32-0ubuntu0.16.04.1. Upgrade your
PHP version to take advantage of performance and security updates
provided by the PHP Group as soon as your distribution supports it.
So, I tried to upgrade me OS (Ubuntu 16.04), by executing:
apt-get update
apt-get dist-update
Then I restarted the server and I re-executed the above commands. After all these, when I connect from terminal I am getting:
Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.4.0-83-generic x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
0 packages can be updated.
0 updates are security updates.
and my PHP version is still PHP 7.0.32-0ubuntu0.16.04.1 (cli) ( NTS ).
This means that PHP 7.0.32 is the latest possible version that I can install in ubuntu 16.04;
16.04 upgrade php nextcloud
16.04 upgrade php nextcloud
edited Jan 22 at 14:02
pa4080
14.1k52666
14.1k52666
asked Jan 22 at 11:01
yaylitzisyaylitzis
181229
181229
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26
add a comment |
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26
add a comment |
2 Answers
2
active
oldest
votes
The default PHP version for Ubuntu 16.04 is 7.0. If you want to install a new version of PHP on 16.04 you need to use an additional PPA (as it is shown below) or you must compile it on your own.
My server with Ubuntu 16.04 currently uses PHP 7.2 and there are several operational instances of WordPress and MediaWiki. The web server is Apache 2.4. The commands that I've used to migrate from PHP 7.0 to 7.2 are:
# Add the repository 'ppa:ondrej/php'
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 7.2
sudo apt install -y php7.2 php7.2-cli libapache2-mod-php7.2
sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd
sudo apt install -y php7.2-common php7.2-mysql php7.2-cgi
sudo apt install -y php7.2-curl php7.2-zip php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-xsl
sudo apt install -y php7.2-dev php7.2-bz2 php7.2-intl php7.2-json php7.2-opcache php7.2-readline
sudo apt install -y php7.2-imap php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy #php7.2-mcrypt
# Update the Apache's PHP version
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2.service
# Update the CLI PHP version
sudo update-alternatives --set php /usr/bin/php7.2
In the repository ppa:ondrej/php PHP 7.3 is also available, I think to migrate soon to this latest version. Here are the additional tweaks of my /etc/php/7.2/apache2/php.ini that are made according to few WordPress and MediaWiki manuals:
zlib.output_compression = On
max_execution_time = 600
max_input_vars = 3000
memory_limit = 512M
post_max_size = 256M
upload_max_filesize = 128M
allow_url_fopen = Off
pcre.backtrack_limit=1000000
session.cookie_secure = True
session.gc_maxlifetime = 14400
session.cache_expire = 540
mbstring.encoding_translation = On
add a comment |
You can install a newer, manually. But in general, you don't want to do that, because you have to manually download updates and build again.
The point of LTS releases is stability. You know that the PHP version shipped today in 18.04 will be maintained with security updates for five years, without having to upgrade the version - which can lead to problems with programs that depends on current version.
18.04 has PHP 7.2 available. It may be a good upgrade path from 16.04, as both is LTS releases which has a five year support period.
Regarding security, don't rely on the version for this. Ubuntu maintainers and Debian maintainers backport security patches from upstream into supported packages for those five years.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111922%2fupgrade-to-the-latest-php-version-in-ubuntu-16-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The default PHP version for Ubuntu 16.04 is 7.0. If you want to install a new version of PHP on 16.04 you need to use an additional PPA (as it is shown below) or you must compile it on your own.
My server with Ubuntu 16.04 currently uses PHP 7.2 and there are several operational instances of WordPress and MediaWiki. The web server is Apache 2.4. The commands that I've used to migrate from PHP 7.0 to 7.2 are:
# Add the repository 'ppa:ondrej/php'
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 7.2
sudo apt install -y php7.2 php7.2-cli libapache2-mod-php7.2
sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd
sudo apt install -y php7.2-common php7.2-mysql php7.2-cgi
sudo apt install -y php7.2-curl php7.2-zip php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-xsl
sudo apt install -y php7.2-dev php7.2-bz2 php7.2-intl php7.2-json php7.2-opcache php7.2-readline
sudo apt install -y php7.2-imap php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy #php7.2-mcrypt
# Update the Apache's PHP version
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2.service
# Update the CLI PHP version
sudo update-alternatives --set php /usr/bin/php7.2
In the repository ppa:ondrej/php PHP 7.3 is also available, I think to migrate soon to this latest version. Here are the additional tweaks of my /etc/php/7.2/apache2/php.ini that are made according to few WordPress and MediaWiki manuals:
zlib.output_compression = On
max_execution_time = 600
max_input_vars = 3000
memory_limit = 512M
post_max_size = 256M
upload_max_filesize = 128M
allow_url_fopen = Off
pcre.backtrack_limit=1000000
session.cookie_secure = True
session.gc_maxlifetime = 14400
session.cache_expire = 540
mbstring.encoding_translation = On
add a comment |
The default PHP version for Ubuntu 16.04 is 7.0. If you want to install a new version of PHP on 16.04 you need to use an additional PPA (as it is shown below) or you must compile it on your own.
My server with Ubuntu 16.04 currently uses PHP 7.2 and there are several operational instances of WordPress and MediaWiki. The web server is Apache 2.4. The commands that I've used to migrate from PHP 7.0 to 7.2 are:
# Add the repository 'ppa:ondrej/php'
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 7.2
sudo apt install -y php7.2 php7.2-cli libapache2-mod-php7.2
sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd
sudo apt install -y php7.2-common php7.2-mysql php7.2-cgi
sudo apt install -y php7.2-curl php7.2-zip php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-xsl
sudo apt install -y php7.2-dev php7.2-bz2 php7.2-intl php7.2-json php7.2-opcache php7.2-readline
sudo apt install -y php7.2-imap php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy #php7.2-mcrypt
# Update the Apache's PHP version
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2.service
# Update the CLI PHP version
sudo update-alternatives --set php /usr/bin/php7.2
In the repository ppa:ondrej/php PHP 7.3 is also available, I think to migrate soon to this latest version. Here are the additional tweaks of my /etc/php/7.2/apache2/php.ini that are made according to few WordPress and MediaWiki manuals:
zlib.output_compression = On
max_execution_time = 600
max_input_vars = 3000
memory_limit = 512M
post_max_size = 256M
upload_max_filesize = 128M
allow_url_fopen = Off
pcre.backtrack_limit=1000000
session.cookie_secure = True
session.gc_maxlifetime = 14400
session.cache_expire = 540
mbstring.encoding_translation = On
add a comment |
The default PHP version for Ubuntu 16.04 is 7.0. If you want to install a new version of PHP on 16.04 you need to use an additional PPA (as it is shown below) or you must compile it on your own.
My server with Ubuntu 16.04 currently uses PHP 7.2 and there are several operational instances of WordPress and MediaWiki. The web server is Apache 2.4. The commands that I've used to migrate from PHP 7.0 to 7.2 are:
# Add the repository 'ppa:ondrej/php'
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 7.2
sudo apt install -y php7.2 php7.2-cli libapache2-mod-php7.2
sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd
sudo apt install -y php7.2-common php7.2-mysql php7.2-cgi
sudo apt install -y php7.2-curl php7.2-zip php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-xsl
sudo apt install -y php7.2-dev php7.2-bz2 php7.2-intl php7.2-json php7.2-opcache php7.2-readline
sudo apt install -y php7.2-imap php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy #php7.2-mcrypt
# Update the Apache's PHP version
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2.service
# Update the CLI PHP version
sudo update-alternatives --set php /usr/bin/php7.2
In the repository ppa:ondrej/php PHP 7.3 is also available, I think to migrate soon to this latest version. Here are the additional tweaks of my /etc/php/7.2/apache2/php.ini that are made according to few WordPress and MediaWiki manuals:
zlib.output_compression = On
max_execution_time = 600
max_input_vars = 3000
memory_limit = 512M
post_max_size = 256M
upload_max_filesize = 128M
allow_url_fopen = Off
pcre.backtrack_limit=1000000
session.cookie_secure = True
session.gc_maxlifetime = 14400
session.cache_expire = 540
mbstring.encoding_translation = On
The default PHP version for Ubuntu 16.04 is 7.0. If you want to install a new version of PHP on 16.04 you need to use an additional PPA (as it is shown below) or you must compile it on your own.
My server with Ubuntu 16.04 currently uses PHP 7.2 and there are several operational instances of WordPress and MediaWiki. The web server is Apache 2.4. The commands that I've used to migrate from PHP 7.0 to 7.2 are:
# Add the repository 'ppa:ondrej/php'
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
# Install PHP 7.2
sudo apt install -y php7.2 php7.2-cli libapache2-mod-php7.2
sudo apt install -y php-imagick php-gettext php-memcache php-apcu php-pear php-xml php-xmlrpc
sudo apt install -y php-memcached php-mysql php-intl php-mbstring php-curl php-gd
sudo apt install -y php7.2-common php7.2-mysql php7.2-cgi
sudo apt install -y php7.2-curl php7.2-zip php7.2-mbstring php7.2-xmlrpc php7.2-gd php7.2-xml php7.2-xsl
sudo apt install -y php7.2-dev php7.2-bz2 php7.2-intl php7.2-json php7.2-opcache php7.2-readline
sudo apt install -y php7.2-imap php7.2-pspell php7.2-recode php7.2-sqlite3 php7.2-tidy #php7.2-mcrypt
# Update the Apache's PHP version
sudo a2dismod php7.0
sudo a2enmod php7.2
sudo systemctl restart apache2.service
# Update the CLI PHP version
sudo update-alternatives --set php /usr/bin/php7.2
In the repository ppa:ondrej/php PHP 7.3 is also available, I think to migrate soon to this latest version. Here are the additional tweaks of my /etc/php/7.2/apache2/php.ini that are made according to few WordPress and MediaWiki manuals:
zlib.output_compression = On
max_execution_time = 600
max_input_vars = 3000
memory_limit = 512M
post_max_size = 256M
upload_max_filesize = 128M
allow_url_fopen = Off
pcre.backtrack_limit=1000000
session.cookie_secure = True
session.gc_maxlifetime = 14400
session.cache_expire = 540
mbstring.encoding_translation = On
edited Jan 27 at 17:50
answered Jan 22 at 12:30
pa4080pa4080
14.1k52666
14.1k52666
add a comment |
add a comment |
You can install a newer, manually. But in general, you don't want to do that, because you have to manually download updates and build again.
The point of LTS releases is stability. You know that the PHP version shipped today in 18.04 will be maintained with security updates for five years, without having to upgrade the version - which can lead to problems with programs that depends on current version.
18.04 has PHP 7.2 available. It may be a good upgrade path from 16.04, as both is LTS releases which has a five year support period.
Regarding security, don't rely on the version for this. Ubuntu maintainers and Debian maintainers backport security patches from upstream into supported packages for those five years.
add a comment |
You can install a newer, manually. But in general, you don't want to do that, because you have to manually download updates and build again.
The point of LTS releases is stability. You know that the PHP version shipped today in 18.04 will be maintained with security updates for five years, without having to upgrade the version - which can lead to problems with programs that depends on current version.
18.04 has PHP 7.2 available. It may be a good upgrade path from 16.04, as both is LTS releases which has a five year support period.
Regarding security, don't rely on the version for this. Ubuntu maintainers and Debian maintainers backport security patches from upstream into supported packages for those five years.
add a comment |
You can install a newer, manually. But in general, you don't want to do that, because you have to manually download updates and build again.
The point of LTS releases is stability. You know that the PHP version shipped today in 18.04 will be maintained with security updates for five years, without having to upgrade the version - which can lead to problems with programs that depends on current version.
18.04 has PHP 7.2 available. It may be a good upgrade path from 16.04, as both is LTS releases which has a five year support period.
Regarding security, don't rely on the version for this. Ubuntu maintainers and Debian maintainers backport security patches from upstream into supported packages for those five years.
You can install a newer, manually. But in general, you don't want to do that, because you have to manually download updates and build again.
The point of LTS releases is stability. You know that the PHP version shipped today in 18.04 will be maintained with security updates for five years, without having to upgrade the version - which can lead to problems with programs that depends on current version.
18.04 has PHP 7.2 available. It may be a good upgrade path from 16.04, as both is LTS releases which has a five year support period.
Regarding security, don't rely on the version for this. Ubuntu maintainers and Debian maintainers backport security patches from upstream into supported packages for those five years.
answered Jan 22 at 11:18
vidarlovidarlo
10.4k52447
10.4k52447
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1111922%2fupgrade-to-the-latest-php-version-in-ubuntu-16-04%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Regarding advantage of performance, the message might be correct. Regarding security updates, nextcloud message is wrong, as security updates will be backported from canonical to the version provided by main repository. So, you could stick with your php version without any security implications.
– RoVo
Jan 22 at 13:26