0

I have different version of Php on my laravel homestead. If i lunch php -v on command bash i have active php 7.3 but if i create and index.php with phpinfo() i have this 'PHP Version 7.2.14-1+ubuntu18.04.1+deb.sury.org+1'

php -v

HP 7.3.1-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Jan 13 2019 10:19:33) ( NTS ) Copyright (c) 1997-2018 The PHP Group Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies with Zend OPcache v7.3.1-1+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies with Xdebug v2.7.0beta1, Copyright (c) 2002-2018, by Derick Rethans with blackfire v1.24.2~linux-x64-non_zts73, https://blackfire.io, by Blackfire

in my index.php

phpinfo();

i have

PHP Version 7.2.14-1+ubuntu18.04.1+deb.sury.org+1

I want to use only php 7.3 how can i do it please?

palla451
  • 53
  • 1
  • 8

1 Answers1

1

For ubuntu users this should work (with apache)

sudo a2dismod php7.X
sudo a2enmod php7.3
sudo service apache2 restart

Witn nginx in your .conf change the version for fastcgi

fastcgi_pass unix:/run/php/php7.3-fpm.sock;
service nginx restart
Eliott
  • 252
  • 3
  • 18
  • i don't use a2dismod beacause homesead is an ngnix server. i have this result: ERROR: Module php7.2 does not exist! ERROR: Module sudo does not exist! ERROR: Module a2enmod does not exist! ERROR: Module php7.3 does not exist! ERROR: Module sudo does not exist! ERROR: Module service does not exist! ERROR: Module apache2 does not exist! ERROR: Module restart does not exist! – palla451 Jan 30 '19 at 19:08
  • Elliot your answer would work on a non-Laravel Homestead installation but it's not relevant for Laravel Homestead. To avoid downvotes it might be best to remove this as an answer because it's technically wrong. – Spencer Hill Aug 20 '21 at 04:36