Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Composer Installation Failure in Docker for PHP Project #518

Open
loyal812 opened this issue Jun 10, 2024 · 0 comments
Open

Composer Installation Failure in Docker for PHP Project #518

loyal812 opened this issue Jun 10, 2024 · 0 comments

Comments

@loyal812
Copy link

Environment

  • Operating System: [AWS EC2, Ubuntu 22.04]
  • Docker Version: [4.30]
  • PHP Version: [PHP 7.4]
  • Docker Image Used: [php:7.4-cli]

Issue Description

I am currently developing a PHP project using Docker, and I am encountering a recurring issue where Composer is not found during the setup process. This is preventing me from managing dependencies for my PHP project efficiently.

Expected Behavior

I expect Composer to be installed and available within the Docker container so that PHP dependencies can be managed and installed without any errors.

Actual Behavior

Whenever I attempt to install Composer dependencies or simply check the Composer version within the Docker container, I receive the following error:

docker build -t php-test .
/bin/sh: 1: composer: not found
The command '/bin/sh -c composer install' returned a non-zero code: 127

Attempts to Resolve

  • I have tried adding Composer directly in the Dockerfile using various snippets found in official documentation and forums such as:
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

However, the issue persists.

I have verified that PATH environment contains /usr/local/bin.

Request

I would appreciate any assistance on how to properly install and configure Composer within the Docker environment for PHP projects. If additional information is required, please let me know.

Thank you for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant