SA__ SA__ - 4 months ago 7x
PHP Question

php composer can't accessed inside public_html folder

I installed composer inside my server. Here is what my files look like via ssh

enter image description here

When i type composer from here it is working, but when i navigate inside public_html folder and type composer it is responding as

-bash: composer: command not found
like this.

What should i do to make composer accessible from public_html folder too


You can use the absolute path. It looks like composer is your home directory, so this should work:


Another solution is to add the directory to your PATH. However, you not install software in your home directory. Install composer at a better location, recommended by your operating system. Then, that directory is likely to be already on PATH, so simply running composer will work everywhere.