dongzhuo5425
2017-04-21 00:59
浏览 248
已采纳

Magento 2没有构建产品缩略图缓存

There are other, similar questions out there but non of which have the correct answer for me.

I have a fresh Magento 2 installation, built using composer. I have done nothing on it apart from install sample data using the php bin/magento sampledata:deploy command followed by setup:upgrade, setup:di:compile and setup:static-content:deploy.

When I go to a category page, the images are all 404-ing. The folder pub/media/catalog/product/cache is not being generated. The permissions are as per the Magento 2 docs:

pub/media/catalog/product$ ll
drwxrwsrwx  8 matt     www-data 4096 Apr 21 10:38 ./
drwxrwsr-x  3 matt     www-data 4096 Apr 20 14:02 ../
drwxrwsr-x 35 www-data www-data 4096 Apr 21 10:35 cache/
drwxrwsrwx  3 matt     www-data 4096 Apr 20 14:02 g/
drwxrwsrwx  4 matt     www-data 4096 Apr 20 14:02 l/
drwxrwsrwx  9 matt     www-data 4096 Apr 20 14:02 m/
drwxrwsrwx  4 matt     www-data 4096 Apr 20 14:02 u/
drwxrwsrwx  9 matt     www-data 4096 Apr 20 14:02 w/

I have GD installed and am running PHP 5.6.

The memory limit in my php.ini file is set to 2048M. I know this is far too high but I was ruling out the memory limit as a cause.

I have reinstalled Magento 2 several times.

I have created PHP script to create folders and files within the product cache directory and that works without issues.

When I go to a product view page or run php bin/magento catalog:images:resize, the pub/media/catalog/product/cache folder is generated.

I have no idea what to do from here! Let me know if you need anything else from me.

Would really appreciate any kind of help on this!

For reference, here is a list of enabled PHP modules:

[PHP Modules]
calendar, Core, ctype, curl, date, dom, ereg, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, libxml, mbstring, mcrypt, mhash, mysql, mysqli, mysqlnd, openssl, pcntl, pcre, PDO, pdo_mysql, Phar, posix, readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zlib

[Zend Modules]
Zend OPcache

图片转代码服务由CSDN问答提供 功能建议

还有其他类似的问题,但没有对我有正确的答案。 \ n

我有一个新的Magento 2安装,使用composer构建。 除了使用 php bin / magento sampledata:deploy 命令然后 setup:upgrade setup:di:compile <安装示例数据之外,我没有做任何事情。 / code>和 setup:static-content:deploy

当我转到类别页面时,图像全部为404。 未生成文件夹 pub / media / catalog / product / cache 。 权限是根据Magento 2文档:

  pub / media / catalog / product $ ll 
drwxrwsrwx 8 matt www-data 4096 Apr 21 10:38 ./
rwxrwsr  -x 3 matt www-data 4096 Apr 20 14:02 ../
rwxrwsr-x 35 www-data www-data 4096 Apr 21 10:35 cache / 
drwxrwsrwx 3 matt www-data 4096 Apr 20 14:02 g /  
drwxrwsrwx 4 matt www-data 4096 Apr 20 14:02 l / 
drwxrwsrwx 9 matt www-data 4096 Apr 20 14:02 m / 
drwxrwsrwx 4 matt www-data 4096 Apr 20 14:02 u / 
drwxrwsrwx 9 matt www  -data 4096 Apr 20 14:02 w / 
   
 
 

我安装了GD并运行PHP 5.6。

内存 我的php.ini文件中的限制设置为2048M。 我知道这太高了,但我排除了内存限制作为原因。

我已经多次重新安装了Magento 2。

I 已创建PHP脚本以在产品缓存目录中创建文件夹和文件,并且没有问题。

当我转到产品视图页面或运行 php bin / magento目录时: images:resize 生成

我没有 想从这里做什么! 如果您需要我提供的任何其他信息,请告诉我。

非常感谢您提供的任何帮助!

供参考,以下是列表 已启用的PHP模块:

  [PHP Modules] 
calendar,Core,ctype,curl,date,dom,ereg,exif,fileinfo,filter,ftp,gd,gettext,  hash,iconv,intl,json,libxml,mbstring,mcrypt,mhash,mysql,mysqli,mysqlnd,openssl,pcntl,pcre,PDO,pdo_mysql,Phar,posix,readline,Reflection,session,shmop,SimpleXML,soap,socket,  SPL,标准,sysvmsg,sysvsem,sysvshm,tokenizer,wddx,xml,xmlreader,xmlwriter,xsl,Zend OPcache,zlib 
 
 [Zend Modules] 
Zend OPcache 
   
 <  / DIV>
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • douhuan6305 2017-04-22 00:53
    已采纳

    So I finally found the issue tracked on GitHub for the Magento 2 repo here

    The only solution (for now) is to modify your composer.json file and change any references for 2.1.6 to 2.1.5. For example:

    {
      "name": "magento/project-community-edition",
      "description": "eCommerce Platform for Growth (Community Edition)",
      "type": "project",
      "version": "2.1.5", // Here
      "license": [
        "OSL-3.0",
        "AFL-3.0"
      ],
      "require": {
        "magento/product-community-edition": "2.1.5", // Here
        "composer/composer": "@alpha",
        "bitexpert/magento2-force-customer-login": "1.3.1",
        "magento/data-migration-tool": "2.1.5" // Here
      },
    ...
    

    Then run composer update.

    As always when changing Magento 2 versions, fun the following commands:

    1. php bin/magento setup:upgrade
    2. php bin/magento setup:di:compile
    3. php bin/magento setup:static-content:deploy

    It's a little annoying that this is a problem caused by the Magento dev team but keep an eye on the issue linked above. I am sure they will realease a fix soon.

    Happy Magentoing!

    打赏 评论

相关推荐 更多相似问题