I'm trying to reindexing my Magento 2 I have done these steps in putty

enter image description here

can anyone tell me what did I do wrong? I'm new in using SSH that's why

thank you so much.

2 Answers 2


You need to write:

cd public_html/magedemo instead of cd /public_html/magedemo

You will then be in the root directory of your installation and bin/magento commands will hopefully work.


To check whether you are running the commands from the right place or not, you can do the following:

Step 1: Create/upload a file (say: info.php) and put the following content in the file:


and open the following URL in the browser:


Step 2: Note down the path mentioned under the heading document_root.


Step 3: Run the following command to change the directory:

cd [the-path-noted-in-step-2-as-document_root]

Step 4: Now try to run any Magento 2 command from this location. If still, you are getting the same error, please comment or update the question.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.