SA__ SA__ - 1 year ago 66
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

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download