How to upgrade the php version in Lampp in Ubuntu The 2019 Stack Overflow Developer Survey Results Are InHow to upgrade to php 7.2 version in xamppHow to enable PHP on LAMPP?Ubuntu-Lampp PHP path issueHow to update PHP to the newest version(5.5) on LAMPP Ubuntu 12.10Why do I get an error trying to install php5-intl?Installation of gnome-core on Ubuntu 14.04 LTS (Trusty Tahr)broken packages with PgAdmin3 version 1.20 in Ubuntu 14 LTSError after attempting to update php lampp and reinstall lamppbus error core dumpedUbuntu 14.04 mod_ssl not availableHow to upgrade to php 7.2 version in xampp
Geography at the pixel level
Why is the maximum length of OpenWrt’s root password 8 characters?
Can a flute soloist sit?
What is the accessibility of a package's `Private` context variables?
Resizing object distorts it (Illustrator CC 2018)
Aging parents with no investments
Why isn't the circumferential light around the M87 black hole's event horizon symmetric?
Time travel alters history but people keep saying nothing's changed
What is the closest word meaning "respect for time / mindful"
Right tool to dig six foot holes?
"as much details as you can remember"
What is the formula behind each level spell slot progression that I can use in a spreadsheet?
Can we generate random numbers using irrational numbers like π and e?
Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?
Identify This Plant (Flower)
How to answer pointed "are you quitting" questioning when I don't want them to suspect
Am I thawing this London Broil safely?
Identify boardgame from Big movie
Origin of "cooter" meaning "vagina"
How to obtain Confidence Intervals for a LASSO regression?
Is "plugging out" electronic devices an American expression?
Why hard-Brexiteers don't insist on a hard border to prevent illegal immigration after Brexit?
Why do UK politicians seemingly ignore opinion polls on Brexit?
What to do when moving next to a bird sanctuary with a loosely-domesticated cat?
How to upgrade the php version in Lampp in Ubuntu
The 2019 Stack Overflow Developer Survey Results Are InHow to upgrade to php 7.2 version in xamppHow to enable PHP on LAMPP?Ubuntu-Lampp PHP path issueHow to update PHP to the newest version(5.5) on LAMPP Ubuntu 12.10Why do I get an error trying to install php5-intl?Installation of gnome-core on Ubuntu 14.04 LTS (Trusty Tahr)broken packages with PgAdmin3 version 1.20 in Ubuntu 14 LTSError after attempting to update php lampp and reinstall lamppbus error core dumpedUbuntu 14.04 mod_ssl not availableHow to upgrade to php 7.2 version in xampp
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I need to upgrade the php version to 7.2 in my Lampp. Actually, when I am checking php -v in terminal, it's showing the following result:
PHP 7.2.1-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2018 22:52:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.1-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
But I am running the file from opt/lampp/htdocs and there I am getting the php version as 5.6.3 which needs to be upgraded to 7.2. I was referring the following steps to install this originally.
sudo apt-get install apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
Package manager info:
$ apt-cache policy apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
apache2:
Installed: 2.4.7-1ubuntu4.18
Candidate: 2.4.7-1ubuntu4.18
Version table:
2.4.10-1ubuntu1.1~ubuntu14.04.2 0
100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 2.4.7-1ubuntu4.18 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2.4.7-1ubuntu4 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
mysql-server:
Installed: 5.5.58-0ubuntu0.14.04.1
Candidate: 5.5.58-0ubuntu0.14.04.1
Version table:
*** 5.5.58-0ubuntu0.14.04.1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.35+dfsg-1ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
phpmyadmin:
Installed: 4:4.0.10-1
Candidate: 4:4.0.10-1
Version table:
*** 4:4.0.10-1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
100 /var/lib/dpkg/status
N: Unable to locate package php7-mysql
N: Unable to locate package php7
N: Unable to locate package libapache2-mod-php7
N: Unable to locate package php7-mcrypt
14.04 upgrade lamp php7
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
|
show 9 more comments
I need to upgrade the php version to 7.2 in my Lampp. Actually, when I am checking php -v in terminal, it's showing the following result:
PHP 7.2.1-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2018 22:52:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.1-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
But I am running the file from opt/lampp/htdocs and there I am getting the php version as 5.6.3 which needs to be upgraded to 7.2. I was referring the following steps to install this originally.
sudo apt-get install apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
Package manager info:
$ apt-cache policy apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
apache2:
Installed: 2.4.7-1ubuntu4.18
Candidate: 2.4.7-1ubuntu4.18
Version table:
2.4.10-1ubuntu1.1~ubuntu14.04.2 0
100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 2.4.7-1ubuntu4.18 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2.4.7-1ubuntu4 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
mysql-server:
Installed: 5.5.58-0ubuntu0.14.04.1
Candidate: 5.5.58-0ubuntu0.14.04.1
Version table:
*** 5.5.58-0ubuntu0.14.04.1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.35+dfsg-1ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
phpmyadmin:
Installed: 4:4.0.10-1
Candidate: 4:4.0.10-1
Version table:
*** 4:4.0.10-1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
100 /var/lib/dpkg/status
N: Unable to locate package php7-mysql
N: Unable to locate package php7
N: Unable to locate package libapache2-mod-php7
N: Unable to locate package php7-mcrypt
14.04 upgrade lamp php7
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to7.2when I am checking it viaphp -vits showing the my correct version. But when I am running one php file fromopt/lampp/htdocsby writing the codephpinfo();its showing that older version which is my issue. Here I need to get that latest version.
– subhra
Jan 18 '18 at 12:32
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster : Ok, Let me to provide the steps.1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.
– subhra
Jan 18 '18 at 12:59
|
show 9 more comments
I need to upgrade the php version to 7.2 in my Lampp. Actually, when I am checking php -v in terminal, it's showing the following result:
PHP 7.2.1-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2018 22:52:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.1-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
But I am running the file from opt/lampp/htdocs and there I am getting the php version as 5.6.3 which needs to be upgraded to 7.2. I was referring the following steps to install this originally.
sudo apt-get install apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
Package manager info:
$ apt-cache policy apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
apache2:
Installed: 2.4.7-1ubuntu4.18
Candidate: 2.4.7-1ubuntu4.18
Version table:
2.4.10-1ubuntu1.1~ubuntu14.04.2 0
100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 2.4.7-1ubuntu4.18 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2.4.7-1ubuntu4 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
mysql-server:
Installed: 5.5.58-0ubuntu0.14.04.1
Candidate: 5.5.58-0ubuntu0.14.04.1
Version table:
*** 5.5.58-0ubuntu0.14.04.1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.35+dfsg-1ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
phpmyadmin:
Installed: 4:4.0.10-1
Candidate: 4:4.0.10-1
Version table:
*** 4:4.0.10-1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
100 /var/lib/dpkg/status
N: Unable to locate package php7-mysql
N: Unable to locate package php7
N: Unable to locate package libapache2-mod-php7
N: Unable to locate package php7-mcrypt
14.04 upgrade lamp php7
I need to upgrade the php version to 7.2 in my Lampp. Actually, when I am checking php -v in terminal, it's showing the following result:
PHP 7.2.1-1+ubuntu14.04.1+deb.sury.org+1 (cli) (built: Jan 11 2018 22:52:58) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.2.1-1+ubuntu14.04.1+deb.sury.org+1, Copyright (c) 1999-2017, by Zend Technologies
But I am running the file from opt/lampp/htdocs and there I am getting the php version as 5.6.3 which needs to be upgraded to 7.2. I was referring the following steps to install this originally.
sudo apt-get install apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
Package manager info:
$ apt-cache policy apache2 mysql-server php7-mysql php7 libapache2-mod-php7 php7-mcrypt phpmyadmin
apache2:
Installed: 2.4.7-1ubuntu4.18
Candidate: 2.4.7-1ubuntu4.18
Version table:
2.4.10-1ubuntu1.1~ubuntu14.04.2 0
100 http://in.archive.ubuntu.com/ubuntu/ trusty-backports/main amd64 Packages
*** 2.4.7-1ubuntu4.18 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
2.4.7-1ubuntu4 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
mysql-server:
Installed: 5.5.58-0ubuntu0.14.04.1
Candidate: 5.5.58-0ubuntu0.14.04.1
Version table:
*** 5.5.58-0ubuntu0.14.04.1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu/ trusty-security/main amd64 Packages
100 /var/lib/dpkg/status
5.5.35+dfsg-1ubuntu1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/main amd64 Packages
phpmyadmin:
Installed: 4:4.0.10-1
Candidate: 4:4.0.10-1
Version table:
*** 4:4.0.10-1 0
500 http://in.archive.ubuntu.com/ubuntu/ trusty/universe amd64 Packages
100 /var/lib/dpkg/status
N: Unable to locate package php7-mysql
N: Unable to locate package php7
N: Unable to locate package libapache2-mod-php7
N: Unable to locate package php7-mcrypt
14.04 upgrade lamp php7
14.04 upgrade lamp php7
edited Jan 18 '18 at 13:11
David Foerster
28.6k1367113
28.6k1367113
asked Jan 18 '18 at 11:51
subhrasubhra
134126
134126
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to7.2when I am checking it viaphp -vits showing the my correct version. But when I am running one php file fromopt/lampp/htdocsby writing the codephpinfo();its showing that older version which is my issue. Here I need to get that latest version.
– subhra
Jan 18 '18 at 12:32
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster : Ok, Let me to provide the steps.1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.
– subhra
Jan 18 '18 at 12:59
|
show 9 more comments
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to7.2when I am checking it viaphp -vits showing the my correct version. But when I am running one php file fromopt/lampp/htdocsby writing the codephpinfo();its showing that older version which is my issue. Here I need to get that latest version.
– subhra
Jan 18 '18 at 12:32
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster : Ok, Let me to provide the steps.1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.
– subhra
Jan 18 '18 at 12:59
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to
7.2 when I am checking it via php -v its showing the my correct version. But when I am running one php file from opt/lampp/htdocs by writing the code phpinfo(); its showing that older version which is my issue. Here I need to get that latest version.– subhra
Jan 18 '18 at 12:32
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to
7.2 when I am checking it via php -v its showing the my correct version. But when I am running one php file from opt/lampp/htdocs by writing the code phpinfo(); its showing that older version which is my issue. Here I need to get that latest version.– subhra
Jan 18 '18 at 12:32
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster : Ok, Let me to provide the steps.
1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.– subhra
Jan 18 '18 at 12:59
@DavidFoerster : Ok, Let me to provide the steps.
1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.– subhra
Jan 18 '18 at 12:59
|
show 9 more comments
2 Answers
2
active
oldest
votes
Seems you have already installed the newest version of PHP, then jump into the 2nd part of this answer. Please check you have installed LAMP stack correctly, follow a tutorial like this,
Lamp Installation tutorial or this.
Then please follow the exact steps.First,
1. Install the newest version of PHP on your Linux machine
# apt update
Then install following packages to install PHP newest PHP versions using PPA,
# apt install python-software-properties
# add-apt-repository ppa:ondrej/php
Then,
# apt update
Then you can check PHP versions available in apt,
$ apt show php -a | grep version or $ apt show php -a | grep -i version
Then install the newest version available in there.For an example, if you want to install PHP version 7.2,
# apt install php7.2
To check if the PHP is in the newest version, run the following command,
$ php -v
2. Change the PHP version of the lamp
# a2dismod php5 to disable current version
# a2enmod php7.2 to enable current version
# service apache2 restart or # /etc/init.d/apache2 restart
Hope you found it useful.
add a comment |
Try this steps and your php version will get upgraded.
apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
then check php version,
php-v
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
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%2f997317%2fhow-to-upgrade-the-php-version-in-lampp-in-ubuntu%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
Seems you have already installed the newest version of PHP, then jump into the 2nd part of this answer. Please check you have installed LAMP stack correctly, follow a tutorial like this,
Lamp Installation tutorial or this.
Then please follow the exact steps.First,
1. Install the newest version of PHP on your Linux machine
# apt update
Then install following packages to install PHP newest PHP versions using PPA,
# apt install python-software-properties
# add-apt-repository ppa:ondrej/php
Then,
# apt update
Then you can check PHP versions available in apt,
$ apt show php -a | grep version or $ apt show php -a | grep -i version
Then install the newest version available in there.For an example, if you want to install PHP version 7.2,
# apt install php7.2
To check if the PHP is in the newest version, run the following command,
$ php -v
2. Change the PHP version of the lamp
# a2dismod php5 to disable current version
# a2enmod php7.2 to enable current version
# service apache2 restart or # /etc/init.d/apache2 restart
Hope you found it useful.
add a comment |
Seems you have already installed the newest version of PHP, then jump into the 2nd part of this answer. Please check you have installed LAMP stack correctly, follow a tutorial like this,
Lamp Installation tutorial or this.
Then please follow the exact steps.First,
1. Install the newest version of PHP on your Linux machine
# apt update
Then install following packages to install PHP newest PHP versions using PPA,
# apt install python-software-properties
# add-apt-repository ppa:ondrej/php
Then,
# apt update
Then you can check PHP versions available in apt,
$ apt show php -a | grep version or $ apt show php -a | grep -i version
Then install the newest version available in there.For an example, if you want to install PHP version 7.2,
# apt install php7.2
To check if the PHP is in the newest version, run the following command,
$ php -v
2. Change the PHP version of the lamp
# a2dismod php5 to disable current version
# a2enmod php7.2 to enable current version
# service apache2 restart or # /etc/init.d/apache2 restart
Hope you found it useful.
add a comment |
Seems you have already installed the newest version of PHP, then jump into the 2nd part of this answer. Please check you have installed LAMP stack correctly, follow a tutorial like this,
Lamp Installation tutorial or this.
Then please follow the exact steps.First,
1. Install the newest version of PHP on your Linux machine
# apt update
Then install following packages to install PHP newest PHP versions using PPA,
# apt install python-software-properties
# add-apt-repository ppa:ondrej/php
Then,
# apt update
Then you can check PHP versions available in apt,
$ apt show php -a | grep version or $ apt show php -a | grep -i version
Then install the newest version available in there.For an example, if you want to install PHP version 7.2,
# apt install php7.2
To check if the PHP is in the newest version, run the following command,
$ php -v
2. Change the PHP version of the lamp
# a2dismod php5 to disable current version
# a2enmod php7.2 to enable current version
# service apache2 restart or # /etc/init.d/apache2 restart
Hope you found it useful.
Seems you have already installed the newest version of PHP, then jump into the 2nd part of this answer. Please check you have installed LAMP stack correctly, follow a tutorial like this,
Lamp Installation tutorial or this.
Then please follow the exact steps.First,
1. Install the newest version of PHP on your Linux machine
# apt update
Then install following packages to install PHP newest PHP versions using PPA,
# apt install python-software-properties
# add-apt-repository ppa:ondrej/php
Then,
# apt update
Then you can check PHP versions available in apt,
$ apt show php -a | grep version or $ apt show php -a | grep -i version
Then install the newest version available in there.For an example, if you want to install PHP version 7.2,
# apt install php7.2
To check if the PHP is in the newest version, run the following command,
$ php -v
2. Change the PHP version of the lamp
# a2dismod php5 to disable current version
# a2enmod php7.2 to enable current version
# service apache2 restart or # /etc/init.d/apache2 restart
Hope you found it useful.
edited Apr 29 '18 at 21:42
answered Apr 29 '18 at 20:50
Chathura D RanathungaChathura D Ranathunga
11
11
add a comment |
add a comment |
Try this steps and your php version will get upgraded.
apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
then check php version,
php-v
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
add a comment |
Try this steps and your php version will get upgraded.
apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
then check php version,
php-v
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
add a comment |
Try this steps and your php version will get upgraded.
apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
then check php version,
php-v
Try this steps and your php version will get upgraded.
apt-get update
sudo apt-get install -y apache2
sudo apt-get install -y php7.0 libapache2-mod-php7.0 php7.0-cli php7.0-common php7.0-mbstring php7.0-gd php7.0-intl php7.0-xml php7.0-mysql php7.0-mcrypt php7.0-zip
then check php version,
php-v
answered Jan 24 '18 at 6:18
Rupesh SarodeRupesh Sarode
1
1
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
add a comment |
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
This won't work unless OP has the proper PPAs added - 14.04 doesn't have PHP 7
– Thomas Ward♦
Apr 29 '18 at 20:53
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%2f997317%2fhow-to-upgrade-the-php-version-in-lampp-in-ubuntu%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
@DavidFoerster : Actually I am little bit confused. Can you please share the steps ?
– subhra
Jan 18 '18 at 12:27
@DavidFoerster : I have shared the exact problem I am facing . Let me to explain you again. I upgraded my PHP version to
7.2when I am checking it viaphp -vits showing the my correct version. But when I am running one php file fromopt/lampp/htdocsby writing the codephpinfo();its showing that older version which is my issue. Here I need to get that latest version.– subhra
Jan 18 '18 at 12:32
It appears you have multiple PHP installations and you only upgraded the one that isn't loaded into the web server. I can't tell you how to upgrade a piece of software if I don't know how it was installed originally.
– David Foerster
Jan 18 '18 at 12:33
@DavidFoerster: Then how to resolve this.
– satya
Jan 18 '18 at 12:50
@DavidFoerster : Ok, Let me to provide the steps.
1-sudo apt-get install apache2, 2-sudo apt-get install mysql-server php7-mysql, 3- sudo apt-get install php7 libapache2-mod-php7 php7-mcrypt, 4-sudo apt install phpmyadmin.– subhra
Jan 18 '18 at 12:59