2

I try to install Laravel 8 to vagrant. The install process works without problem. But the homepage shows the following error:

Fatal error: Composer detected issues in your platform: Your Composer dependencies require a PHP version ">= 7.3.0". You are running 7.2.34-8+ubuntu18.04.1+deb.sury.org+1. in /home/vagrant/code/7time/vendor/composer/platform_check.php on line 24

When I check the version, it shows 7.3

vagrant@homestead:~/code$ php -version
PHP 7.3.24-3+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Oct 31 2020 16:59:59) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.24, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache v7.3.24-3+ubuntu18.04.1+deb.sury.org+1, Copyright (c) 1999-2018, by Zend Technologies

I tried these things:

  • I searched on Google for solution
  • I reinstalled PHP
  • I tried to install Laravel via Laravel installer and via Composer

What might be wrong?

halfer
  • 19,824
  • 17
  • 99
  • 186
Peter
  • 655
  • 1
  • 14
  • 37

1 Answers1

0

Difference CLI / PHP-FPM

$ php -version gives the PHP CLI version, not the PHP-FPM version.

$ service php7.x-fpm status gives the php-fpm status/version.

CLI:

$ php artisan serve , Runs the application through your cli.

Homestead ( Vagrant box ):

Homestead ( Vagrant box ) is using NGINX by default. This means that the application will use PHP-FPM.


Duplicate of:

Change Laravel Homestead v7.0.1 with php 7.2 to php 7.1

How to roll back PHP version in Vagrant and Homestead?

Samuel Ferdary
  • 315
  • 2
  • 11