ERROR: “/app/etc/” must exist for proper tool work

2019-05-18 17:28发布

问题:

I am trying to install the newly release security patch for magento 1.9. I am working on window system.

and I am getting the following error.

D:\xampp\htdocs\magento>sh PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh
ERROR: "/app/etc/" must exist for proper tool work.

I am running command by CMD and SH is working fine too

I tried with Git too. but getting same error

Not working on Linux too

can anyone tell me what is the exact issue and how it could be fixed.

Thanks

回答1:

Able to make it works on windows machine as well for PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh.

Problem was: CURRENT_DIR=$PWD_BIN/ (line 60) and the value of $PWD_BIN is defined in same file PWD_BIN=which pwd (line 35) as which doesn't wok on windows so we will need to replace this value.

  1. Open bash
  2. Your current directory should be the root of magento.
  3. Run command 'pwd'
  4. It will give the out path of your current directory: Check screenshot
  5. Copy this path and edit file, on line 67 replace:

    CURRENT_DIR=$PWD_BIN/ to CURRENT_DIR=/d/xampp/htdocs/magento/

Run patch with same commnd sh PATCH_SUPEE-5344_CE_1.8.0.0_v1-2015-02-10-08-10-38.sh

Note: Make sure you replace '/d/xampp/htdocs/magento/' with your directory root.

and it will work like a charm!!



回答2:

Getting rid of the forward slash at the end of line 67 seems to work better for me.

Before: CURRENT_DIR='$PWD_BIN'/

After: CURRENT_DIR='$PWD_BIN'



回答3:

In SSH, you can change the directory by entering the command, cd /path/to/magento/location/ and then you'll be able to run the bash command to install the patch. If you're not aware of the path, you can run the command, pwd which tells you your current directory. If you're not in the right location, it's looking for app/etc in the wrong location (likely your root folder). So try changing your current directory to the Magento directory and then the error should go away.



回答4:

I was having the same problem and previous answers didn't work for my situation. The way I was able to fix the issue was to change the directory and then run the bash in SSH.

  1. Run the command, pwd. This will give you your current path.
  2. Change the directory to your Magento directory by running the command, cd /path/to/your/magento/directory/. This should be the path from your current location to the Magento destination.
  3. Now run the bash patch update... bash PATCH_SUPEE-1533_EE_1.13.x_v1-2015-02-10-08-18-32.sh. Now that you're in the right location, the patch update should run smooth!


回答5:

This error occurs if you are in your root directory for example and not in your Magento root. Go to your Magento folder and run you command again.

This error happens if the folder is not found or don't have enough permissions.

Use the git bash under windows that should work. With a normal CMD it's not working because there are some difference in the path and the normal CMD can't find that path from your patch file.



回答6:

I have tried above change. But, I need to do some change in that to make it working I changed it CURRENT_DIR=$PWD_BIN to CURRENT_DIR="/D/wamp/www/magento/" It was not working without " (quotes)

Hope this will help you.