Change php path in Composer

0

Good morning, colleagues!

I am starting in Laravel and after some problems with MAMP I preferred not to work with him and I went for XAMPP.

During the installation of Composer I gave him the MAMP php route and would like to redirect to the XAMPP php.

First, how can I really see if the php path in Composer is the one I'm commenting on?

And second, how can I change that php route to another route I want?

    
asked by roberthung 16.10.2018 в 14:35
source

2 answers

0

According to this answer in English:

  • Look for "environment variables" with Cortana (if you know where they are, I think you do not need to ask Cortana ...)
  • Press the environment variable button
  • In system variables, select PATH and edit it
  • In your case, you should see some entry that has to do with MAMP (c: \ MAMP \ bin or similar)
  • Change this route to the one corresponding to the PHP of the XAMPP
  • To check that it worked, open a new command console (cmd) and type php -v and check if you print on the screen the version that matches XAMPP

        
    answered by 18.10.2018 в 19:34
    0

    A good alternative is that you run with specific versions both php artisan and composer install or update, always pointing to the installation directories.

    Example in linux to run composer install:

    /usr/bin/php7.0 / usr / local / bin / composer install

    artisan:

    /usr/bin/php7.0 artisan {command}

        
    answered by 22.10.2018 в 15:21