How to correctly install composer and laravel in MAC's XAMPP?

http://www.frankwaive.com/how...

I have changed the path of php to the version of XAMPP
I also install composer on this machine through homebrew
I just don"t understand his next step:

curl -s http://getcomposer.org/installer | php

and

composer create-project laravel/laravel --prefer-dist

and in the "Applications/XAMPP/htdocs" directory?
so can I choose to install composer to any directory I want? And laraval?
because the project folder I put is not in Applications/XAMPP/htdocs (I have other projects)
I put it in the / Users/XXX/Projects/ project folder (there are other projects here)
so do I have to go to / Users/XXX/Projects/ and install composer in this directory? And laravel? But what was the composer I installed through brew?

Let me first talk about my understanding:
do I install homebrew first, and then install the composer main program through brew?
so if I use composer for every next project, I have to install it again in this directory? Including laravel?
suppose I"m going to use three projects (different websites)
suppose it"s

/Users/XXX/Projects/a
/Users/XXX/Projects/b
/Users/XXX/Projects/c

then I also set the project path and the specified port in httpd-vhosts.conf and httpd.conf of XAMPP, and I can also use 127.0.0.1:port to access a, b, c project
suppose I need composer for all three websites, and I need to write
for all three projects. Do I want a folder to enter these three projects to run the above two codes?

PS: I can"t understand official documents


starts with Composer, a dependency management tool for PHP that, after installation, can be defined as a global command. Guess what the landlord said is that it is not defined as a global command after installing Composer.

you can access composer through a full path in a non-composer directory to see if it can be accessed properly. For example, the installation directory of composer is / etc/bin/composer, execute the command:

/etc/bin/composer -v

if the results are displayed normally, it means that composer is not set as a global command, just set composer as a global command.

followed by laraval. It is an application framework of PHP. Can be understood as a house framework, you need to build a house in different locations, that is, you need to build a frame in each location.

By the same token, you need to use laraval to build different applications in different paths, which means you need to install laraval in different paths.


refer to here

https://docs.phpcomposer.com/...

shouldn't you use brew as a super tool to install anything on mac?
Click here to view


I don't recommend using xampp, you can use brew to install the entire php environment

https://laravel-china.org/art...


Let me post my own local configuration for you. I have more than a dozen domain names locally. Take getup.api.dev.com and amp.dev.com as an example, the configuration is as follows

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/xampp/htdocs/wxa_getup_api/public"
    ServerName getup.api.dev.com
    ErrorLog "logs/getup.api.dev.com-error.log"
    CustomLog "logs/getup.api.dev.comaccess.log" common
</VirtualHost>

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host2.example.com
    DocumentRoot "D:/xampp/htdocs/ali_getup_api/public"
    ServerName amp.dev.com
    ErrorLog "logs/amp.dev.com-error.log"
    CustomLog "logs/amp.dev.com-access.log" common
</VirtualHost>

then add the mapping of the following two addresses to the host file

127.0.0.1 amp.dev.com
127.0.0.1 api.dev.com

it's that simple

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1be47ed-52d9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1be47ed-52d9d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?