Open kevinjavitz opened 8 years ago
This is a bug in PHP when OPcache is not on. http://stackoverflow.com/questions/17746481/cannot-use-x-as-y-because-the-name-is-already-in-use-even-though-its-not/23879699#23879699
I am running php 5.6.30 via Xampp installed yesterday Feb 22 2017 I had the error on a clean Magento 2.1.5 turned on opcache in the php.ini file and no more error.
The fix did not help me. Magento 2.1.5 Php 7.0.12 Opcache enabled.
This is what helped:
In Sample/News/Helper/Image.php
try change
use Sample\News\Model\ImageFactory;
to
use Sample\News\Model\ImageFactory as MyImageFactory;
and in constructor
ImageFactory $imageFactory,
to
MyImageFactory$imageFactory,
Running Mage 2.1.2 and php 7 author details page gives:
Fatal error: Cannot use Sample\News\Model\ImageFactory as ImageFactory because the name is already in use in /var/www/html/magento2/app/code/Sample/News/Helper/Image.php on line 26