Wednesday, February 7, 2024

[SOLVED] For root access composer not found in centos 7

Issue

I installed composer in centos 7. When I logged in with centos user, if I hit composer -v, it shows that composer is installed. But after I switch to root access with sudo su, if I hit composer -v, it displays not found. Can anyone help me? What should I do now?


Solution

What you describe are the symptoms of non-packaged install.

If something is available from packages, you should strive to install it using packages where available.

sudo yum install epel-release
sudo yum install composer
# have no problems, have a cup of coffee


Answered By - Danila Vershinin
Answer Checked By - David Goodson (WPSolving Volunteer)