PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Thursday, January 6, 2022

[FIXED] Command not found: composer

 January 06, 2022     composer-php     No comments   

Issue

I am following this tutorial. When I get to around the 11:48 minute mark, I am supposed to run the command:

composer create-project laravel/laravel .

To which the terminal response is:

zsh: command not found: composer

I am not sure if this is necessary, but here is my docker-composer.yml file:

version: '3'

networks:
  laravel:

services:
  nginx:
    image: nginx:stable-alpine 
    container_name: nginx
    ports: 
        - "8088:80"
    volumes: 
        - ./src:/var/www/html 
        - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
        - php
        - mysql
    networks:
        - laravel

mysql:
    image: mysql:5.7.22
    container_name: mysql
    restart: unless-stopped
    tty: true
    ports: 
        - "4306:3306"
    volumes:
        - ./mysql:/var/lib/mysql
    environment: 
            MYSQL_DATABASE: homestead
            MYSQL_USER: homestead
            MYSQL_PASSWORD: secret
            MYSQL_ROOT_PASSWORD: secret
            SERVICE_TAGS: dev
            SERVICE_NAME: mysql
    networks:
        - laravel

php:
    build: 
        context: .
        dockerfile: Dockerfile
    container_name: php 
    volumes: 
        - ./src:/var/www/html
    ports:
        - "9000:9000"
    networks:
        - laravel

I had to install homebrew before I could install composer using the commands from the composer website.

The terminal confirmed that Composer version 1.10.10 was successfully installed.

Regardless, I'm still getting "command not found: composer" in the terminal.

How do I fix this?


Solution

This problem arises when you have composer installed locally.To make it globally executable,run the below command in terminal

sudo mv composer.phar /usr/local/bin/composer


Answered By - albus_severus
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing