skip to Main Content

I downloaded a laravel 6 demo project and setting it up in my mac mamp. Initialy my php version was 7.1.23 and i was getting this error.

Warning: require(/Applications/MAMP/htdocs/laravel_demo/public/../vendor/autoload.php): failed to open stream: No such file or directory in /Applications/MAMP/htdocs/laravel_demo/public/index.php on line 26

Fatal error: require(): Failed opening required '/Applications/MAMP/htdocs/laravel_demo/public/../vendor/autoload.php' (include_path='.:/Applications/MAMP/bin/php/php7.2.1/lib/php') in /Applications/MAMP/htdocs/laravel_demo/public/index.php on line 26

So i changed my php version to 7.2.1 by renaming old php version folder in mamp. Now if i run phpinfo() It is showing php version 7.2.1. But when i run composer update in terminal i am getting this error.

Problem 1
- This package requires php ^7.2 but your PHP version (7.1.23) does not satisfy that requirement.
Problem 2
- laravel/framework v6.4.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.3.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.2.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.1.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.0.4 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.0.3 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.0.2 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.0.1 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework v6.0.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- laravel/framework 6.x-dev requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
- Installation request for laravel/framework ^6.0 -> satisfiable by laravel/framework[6.x-dev, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4, v6.1.0, v6.2.0, v6.3.0, v6.4.0].

Is this issue related to laravel setup or my php version or am i missing something in updating my php version?

2

Answers


  1. Laravel 6 is required PHP Version is PHP >= 7.2.0.
    your version is 7.1.23 that is lower requirement.

    you install mamp 7.2 or latest versions.

    Login or Signup to reply.
  2. Laravel 6 requires PHP >= 7.2.0 and your version is 7.1.23.

    What happening in this case?

    If you run phpinfo() by a file accessed on your browser via http server. The output maybe different for your terminal. If the PHP enabled on your HTTP server (like apache or nginx) is the newest (7.2) maybe is the case to check the version in your terminal running php -v.

    In some cases the php are updated to http server but, the “cli” version are not updated and points to older version, it depends on the way that the system are updated.

    If this situation is your case, you need to check if php-cli are correctly installed.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search