I have installed PHP 7.3 on my raspberry Pi. When I use phpinfo() in a browser it shows indeed PHP 7.3.
But when I try it in terminal with php -v it says PHP 7.2.24
I searched for installations of PHP 7.2 but it isn’t there.
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libapache2-mod-php7.0/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
libapache2-mod-php7.3/stable,now 7.3.11-1~deb10u1 armhf [installed]
php/oldstable,now 1:7.0+49 all [installed]
php-bz2/oldstable,now 1:7.0+49 all [installed,automatic]
php-common/oldstable,now 1:49 all [installed,automatic]
php-curl/stable,now 2:7.3+69 all [installed,automatic]
php-gd/oldstable,now 1:7.0+49 all [installed,automatic]
php-mbstring/oldstable,now 1:7.0+49 all [installed,automatic]
php-mysql/oldstable,now 1:7.0+49 all [installed,automatic]
php-pear/oldstable,now 1:1.10.1+submodules+notgz-9+deb9u1 all [installed,automatic]
php-php-gettext/oldstable,stable,now 1.0.12-0.1 all [installed,automatic]
php-phpseclib/oldstable,now 2.0.4-1 all [installed,automatic]
php-tcpdf/oldstable,now 6.2.12+dfsg2-1 all [installed,automatic]
php-xml/oldstable,now 1:7.0+49 all [installed,automatic]
php-zip/oldstable,now 1:7.0+49 all [installed,automatic]
php7.0/oldstable,now 7.0.33-0+deb9u6 all [installed,automatic]
php7.0-bz2/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-cli/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-common/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-gd/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-json/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-mbstring/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-mysql/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-opcache/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-readline/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-xml/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.0-zip/oldstable,now 7.0.33-0+deb9u6 armhf [installed,automatic]
php7.3/stable,now 7.3.11-1~deb10u1 all [installed]
php7.3-cli/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-common/stable,now 7.3.11-1~deb10u1 armhf [installed,automatic]
php7.3-curl/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-fpm/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-gd/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-json/stable,now 7.3.11-1~deb10u1 armhf [installed,automatic]
php7.3-mbstring/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-opcache/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-readline/stable,now 7.3.11-1~deb10u1 armhf [installed,automatic]
php7.3-xml/stable,now 7.3.11-1~deb10u1 armhf [installed]
php7.3-zip/stable,now 7.3.11-1~deb10u1 armhf [installed]
phpmyadmin/oldstable,now 4:4.6.6-4 all [installed]
By searching find / -name "*7.2*"
I don’t find anything as well..
How can I say that php -v has to use 7.3 instead?
3
Answers
I solved it by reinstalling apache.
Check if you can execute
php7.3
?It’s possible that
php
is basically pointing to the old version.