Skip to content
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

Error in Author Details Page #16

Open
kevinjavitz opened this issue Oct 27, 2016 · 2 comments
Open

Error in Author Details Page #16

kevinjavitz opened this issue Oct 27, 2016 · 2 comments

Comments

@kevinjavitz
Copy link
Contributor

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

kevinjavitz added a commit to kevinjavitz/Magento2SampleModule that referenced this issue Oct 27, 2016
@ddoddsr
Copy link

ddoddsr commented Feb 23, 2017

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.

tzyganu added a commit that referenced this issue Feb 27, 2017
@eddyonboard
Copy link

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,

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

No branches or pull requests

3 participants