Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

s_chahal's avatar

php -v inside homestead vm showing php version as 7.2.5 however phpinfo() from /public/index.php shows php version as 7.0.30 !!!

the phpinfo() shows that Loaded Configuration File -> /etc/php/7.0/fpm/php.ini

how do i get my app to use php v7.2 ?

NOTE: as suggested on the homestead page adding php: "7.2" in the homestead.yaml file does not work.

0 likes
2 replies
cecil.merrell's avatar

that probably means that the nginx sites-available file for your site is using the php7.0-fpm. It is possible for you to have multiple different versions of php on the server, the nginx config file for the site controls what nginx uses.

you should have something like this when finished..

location / {
 try_files $uri $uri/ /index.php?$query_string;
 }


location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
jlrdw's avatar

Did you re-start everything, servers, etc?

Please or to participate in this conversation.