skip to Main Content

Solution: I’ve updated my OS to the latest version where the latest PHP was supported.

I’ve got a new laravel project
When I run php artisan serve
it shows:

MacBook-Pro% php artisan serve

Warning: require(/Users/username/Desktop/code/argon/vendor/autoload.php): failed to open stream: No such file or directory in /Users/username/Desktop/code/argon/artisan on line 18

Fatal error: require(): Failed opening required '/Users/username/Desktop/code/argon/vendor/autoload.php' (include_path='.:') in /Users/username/Desktop/code/argon/artisan on line 18

composer update shows

MacBook-Pro% composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - This package requires php ^7.2.5 but your PHP version (7.1.23) does not satisfy that requirement.
  Problem 2
    - laravel/tinker v2.2.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
    - laravel/tinker v2.1.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
    - laravel/tinker v2.0.0 requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
    - laravel/tinker 2.x-dev requires php ^7.2 -> your PHP version (7.1.23) does not satisfy that requirement.
    - Installation request for laravel/tinker ^2.0 -> satisfiable by laravel/tinker[2.x-dev, v2.0.0, v2.1.0, v2.2.0].



MacBook-Pro% php -v
PHP 7.1.23 (cli) (built: Nov  7 2018 18:20:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies

also

MacBook-Pro% brew unlink [email protected]
Error: No such keg: /usr/local/Cellar/[email protected]
MacBook-Pro% brew unlink php71
Error: No such keg: /usr/local/Cellar/php71

also

MacBook-Pro% which php
/usr/bin/php

Any ideas how to remove php 7.1.23 ?

2

Answers


  1. Chosen as BEST ANSWER

    Found a solution !

    brew install php72
    brew switch [email protected] 7.2.25
    

    https://laravel.com/docs/6.x/homestead


  2. php -v gives the following response:

    WARNING: PHP is not recommended  
    PHP is included in macOS for compatibility with legacy software.  
    Future versions of macOS will not include PHP.
    The release notes for Catalina contain the following remark:
    

    Info here

    Scripting Language Runtimes Deprecations Scripting language runtimes
    such as Python, Ruby, and Perl are included in macOS for compatibility
    with legacy software. Future versions of macOS won’t include scripting
    language runtimes by default, and might require you to install
    additional packages. If your software depends on scripting languages,
    it’s recommended that you bundle the runtime within the app.

    In short: macOS continues to include ‘legacy’ versions of things like Python, Ruby, Perl, and indeed PHP, so that existing code won’t break, but Apple is leaving it to the user to install the versions that they want to use.

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