I got an error like

error":"Unable to create directory

'/var/www/html/pub/media/tmp/catalog/product'.","errorcode" :0

While upload product images. I put 777 permission /var/www/html/pub/media folder. but i got the error. kindly help me.

  • Pls create manually folder structure at location pub/media/tmp/catalog/product and try again – Abdul Jan 2 '17 at 7:49

Please check permission of media/catalog/products folder and try again.

  • Yes i checked. it also have 777 permission. – bala.skpm Jan 2 '17 at 7:30
  • which php version you are using ? – Ashvini Marwal Jan 2 '17 at 7:41
  • i am using PHP 5.5.38. and magento 2.0.2 version – bala.skpm Jan 2 '17 at 7:45

Your issue in ownership.

Your web user .. ( CentOS: apache and www-data ) does not have the ownership to create folder and files.

See http://devdocs.magento.com/guides/v2.0/install-gde/install/legacy-file-system-perms.html , how to apply ownership in magento2.

As you have using ,please check out http://devdocs.magento.com/guides/v2.0/install-gde/install/post-install-umask.html


the 2.1 release candidate, and with 2.0.6+, if you need permissions for generated assets of 664 and 775

Little bad idea:

For a case, you can change file permission from Magento\Framework\Exception\FileSystemException\DriverInterface You need change WRITEABLE_DIRECTORY_MODE = 0770; to WRITEABLE_DIRECTORY_MODE = 0775;and WRITEABLE_FILE_MODE = 0660 to WRITEABLE_FILE_MODE = 0664.It is working for You.

  • I am following the instruction mentioned but not working – bala.skpm Jan 2 '17 at 8:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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