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

and I am getting the following error.

ERROR: "/app/etc/" must exist for proper tool work.

I am running php code.

    passthru("/bin/bash PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh");
    echo "Done";

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

  • But solution is different ..i have install patch using php code ...prince
    – Devidas
    Aug 1, 2017 at 8:56
  • are you sure you are running from Magento root this code Aug 1, 2017 at 8:57

1 Answer 1


On a Ubuntu System , you can directly run security patch file using


And for the error you are getting it is due the line number 67 ( almost all patch files)


Which fetches the current directory path and sets in very next line

APP_ETC_DIR=echo "$CURRENT_DIR""app/etc/"

So your script is not able to get that CURRENT_DIR variable .

If you still wish to run the patch via php code you can update the patch file with absolute path of the directory like below (on line 67)


and then run the PHP code , it should work

Make sure that you patch file is in the root directory of magento

  • yes i sure patch file in root directory
    – Devidas
    Aug 1, 2017 at 9:19
  • my current path is CURRENT_DIR="/html/PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh"
    – Devidas
    Aug 1, 2017 at 9:21
  • its right or not plz check
    – Devidas
    Aug 1, 2017 at 9:21
  • No that's relative path , give the absolute patch Aug 1, 2017 at 9:35
  • it should be like '/var/www/html/vishwas/Myproject' Aug 1, 2017 at 9:37

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