Hi community, after 2 weeks of endless tries to fix my issue, browsing through every topic on this forum I could find related to my issue, I give up and therefor write this topic.
I have recently installed the latest Magento 2 version on a shared hosting, therefor there is one user in the shell and also one group named same as the user.
When I try to upload a custom image, It all goes well, the image lands on the server, however it is only displayed in the Gallery window (basicly where you see all the uploaded images). Anywhere else, the Chrome console drops me a 500 internal error for that image.
Short explanation: I uploaded a logo.png file, it is only shown in the gallery window where you select the image you want displayed. Anywhere else, and I get a 500 internal server error.
I have tried everything from other topics, including recursively changing permissions which is not the greatest idea. I'm still an amateur, this is my first magento project.
I have tried setting the path to the image to have 777 permissions everywhere on the way, that didn't help. I have tried clearing/flushing the cache, compiling the whole thing, removing var/ folder and then setup:upgrade to retrieve it afterwards, deleting the .htaccess didn't help me discover additional data either.
The only clue I get so far is when I enable the maintenance mode, this is the error line:
1 exception(s): Exception #0 (Exception): Unable to proceed: the maintenance mode is enabled. Exception #0 (Exception): Unable to proceed: the maintenance mode is enabled. <pre>#1 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#000000001f75431900000000663aa90e#) called at [index.php:39] </pre>
I have used the setup:di:compile command, that didn't help. Maybe the issue is with this interceptor?
Please avoid any hate comments, English is my secondary language and I have been studying magento for barely a few months occasionally.
Thanks in advance!
- magento newbie
Solved! Go to Solution.
## enable rewrites Options +FollowSymLinks RewriteEngine on ## you can put here your pub/media folder path relative to web root #RewriteBase /magento/pub/media/
This is fine. Please try to rename the .htaccess of pub/media folder and check again after flushing cache.
EDIT) If I upload the screenshots to a cloud and link it here, would that make you see the images I THINK SO
Hello @florjan_ostrož ,
1. Please disable you maintenance mode by:
bin/magento maintenance:disable
2. Enable developer mode that error is displayed(easy for debuging)
bin/magento deploy:mode:set developer
3. Remove generated:
rm -rf generated/*
4. Please provide permission:
sudo chmod 0777 -R var/ pub/ generated/
5. Compile code by
bin/magento setup:di:compile
6. Check for .htaccess in pub/static and pub/media
7. Flush the cache
bin/magento cache:flush
Then check it again on front end. If still the issue exist the rename the .htaccess of your magento root folder, flush the cache and check again on front end.
Hope this works for you.
If it helps you, please give us kudos and accept it as solution.
Regards.
The problem has not been solved, renaming .htaccess just throws another new error beside 500s for the images.
What do you mean by 6. Check for... ?
I have done everything as you've said, nothing changed. Let me provide you the screenshots of my problem for better visualisation. The first image shows the console of the home page.
As you can see, the images are only displayed in the "Insert images..." window.
Another issue I found out was that the locale changes aren't really applying to the back end, I've selected the Slovenian locale however the only translated string is the one on the last image right after the "Upload" button. Maybe this was worth a mention, however the issue related to the topic is much more important.
Cheers
I have enabled it myself for testing purposes, and then thought the interceptor issue was the cause for my problems with images not being displayed anywhere except in the image selection window ("Insert images" window). See above post for more information, If you're interested in helping me in advance.
Thank you for your reply too.
Hello @florjan_ostrož ,
Sorry the screenshots are not visible to me(I think that is not approved yet) so I cannot understand that much.
By Step 6 I means that .htaccess is also present in pub/static folder and pub/media folder. Please check that .htaccess are present there.
If that didn't work, please rename the .htaccess of pub/media folder
I hope it will help you but still you face the issue, please let me know. Regards.
Yes I have checked for it, both .htaccess files are present (6.). I have noticed something, not sure whether that matters but in the .htaccess I came across this:## enable rewrites
Options +FollowSymLinks
RewriteEngine on
## you can put here your pub/media folder path relative to web root
#RewriteBase /magento/pub/media/
Is this important? Because the relative to the web root it should just be pub/media or public_html/pub/media
I have been looking for the cause for so long I got lost, this might be a useless catch, however I mentioned it just in case.
EDIT) If I upload the screenshots to a cloud and link it here, would that make you see the images? I feel like they are crucial.
## enable rewrites Options +FollowSymLinks RewriteEngine on ## you can put here your pub/media folder path relative to web root #RewriteBase /magento/pub/media/
This is fine. Please try to rename the .htaccess of pub/media folder and check again after flushing cache.
EDIT) If I upload the screenshots to a cloud and link it here, would that make you see the images I THINK SO
Oh my god you did it, renaming the htaccess of the media folder and flushing the cache afterwards worked. THANK YOU WITH CAPS!
You are welcome