There are other similar questions, but I do not have the correct answer.
I have a new Magento 2 installation built using composer. I did nothing with it other than setting the sample data using the command php bin/magento sampledata:deployfollowed setup:upgrade, setup:di:compileand setup:static-content:deploy.
When I go to the category page, all the images are 404. A folder is pub/media/catalog/product/cachenot created. Permissions are consistent with 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 I am running PHP 5.6.
The memory limit in my php.ini file is 2048M. I know this is too high, but I rule out memory limitation as a reason.
I reinstalled Magento 2 several times.
I created a PHP script to create folders and files in the product cache directory, and this works without problems.
php bin/magento catalog:images:resize, pub/media/catalog/product/cache .
, ! , - .
!
, 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, sockets, SPL, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlwriter, xsl, Zend OPcache, zlib
[Zend Modules]
Zend OPcache