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
7.2
when I am checking it viaphp -v
its showing the my correct version. But when I am running one php file fromopt/lampp/htdocs
by 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:321-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:59like this command sudo apt-get install php7.0
. – subhra Jan 18 '18 at 13:17php7.0
instead ofphp7
? In that case could you please amend the output ofapt-cache
to includeapt-cache policy php7.0 libapache2-mod-php7.0 php7.0-mcrypt php7.0-mysql
? Thanks. – David Foerster Jan 18 '18 at 13:45apt-cache
is `apt 1.0.1ubuntu2 for amd64 compiled on Dec 8 2016 16:23:37 Usage: apt-cache [options] command apt-cache [options] showpkg pkg1 [pkg2 ...] apt-cache [options] showsrc pkg1 [pkg2 ...]apt-cache is a low-level tool used to query information from APT's binary cache files
`.
– subhra Jan 18 '18 at 13:53{}
button in the editor toolbar) will be much more readable there; alternatively you can use a pastie service for longer listings and include the link of your pastie in your question. Overall it’s best to have everything relevant in one place. Additionally, comments may be deleted for various reasons. Thanks. – David Foerster Jan 18 '18 at 15:19