Skip to content

Image import broken when using pub documentroot #5359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
markalston opened this issue Jun 29, 2016 · 4 comments
Closed

Image import broken when using pub documentroot #5359

markalston opened this issue Jun 29, 2016 · 4 comments

Comments

@markalston
Copy link

When trying to import with images when document root is set to pub it fails.

I added some logging per issue #4711 and received the following error:

[2016-06-29 15:34:27] main.CRITICAL: Exception: Unable to create directory 'pub/media/catalog/product'. in /var/www/beernut/deploy/live/vendor/magento/framework/File/Uploader.php:579
Stack trace:

0 /var/www/beernut/deploy/live/vendor/magento/framework/File/Uploader.php(252): Magento\Framework\File\Uploader->_createDestinationFolder('pub/media/catal...')

1 /var/www/beernut/deploy/live/vendor/magento/framework/File/Uploader.php(195): Magento\Framework\File\Uploader->validateDestination('pub/media/catal...')

If I set the document root to the magento directory import works fine.

It looks like it is trying to create the pub/media directory inside of pub. This could be fixed by giving magento write permissions in the pub main directory but I think that importing should write to the same files regardless of the documentroot. Seems silly to have magento/pub/pub/media as well as magento/pub/media.

@davidnguyen2205
Copy link

So what is a solution? I got the same problem in 2.1.0 GA

@veloraven
Copy link
Contributor

@markalston thank you for your report.
Please, provide the used version. If the problem is actual for a specific tag, please, specify it and be sure that the latest update was used.
Please also provide description according to the template: with steps, actual result and expected result.

@andimov
Copy link
Contributor

andimov commented Aug 16, 2016

According to contributor guide, tickets without response for two weeks should be closed.
Please feel free to reopen if it's needed.

@andimov andimov closed this as completed Aug 16, 2016
@alexgoodey
Copy link

This is still present in 2.1.0.

A temporary solution is to create a symlink in pub called pub back to itself. e.g.

cd pub/
ln -s ./ pub

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants