Tks Sarvagya Bhai i was also having 500 server error while accessing images inside /pub after a magento 2 upgrade totally forgot to remove .htaccess of pub but your comment pointed me in right direction again seems like we still come face to face helping even after so much time
I was facing the same kind of issue when my website https://cherrycrumble.com/ was under construction.
Hi guys. Since this post is quite high in search results I want to share a method that I used to debug this problem.
The solution was in did to remove .htaccess, however it wasn't in pub/ but pub/media/.
In case it was in any other random location here is a method to find the faulty .httaccess:
1. Locate url of any missing image.
2. Go to pub, create test file and chmod it 777
cd pub vi test.txt i -> "test" -> :wq chmod 777 test.txt
3. Go to url domain.com/pub/test.txt. If the files shows up, move it down the directory of missing image and check if you can access the file again.
4. At some point the file will no longer be accessible - this is the directory with faulty .htaccess.
Alternatively you can rename all .htaccess files down the direcory of image causing 500 but I don't like renaming random files without knowing that that's the issue.
Hi Guys,
I having the exact same issue and being new to Magento am really struggling to get this "small" issue sorted.
Its a base magento 2.3.4 install set to the Luma theme but on my first attempt to add a favicon I get this problem.
I have set the system to store images in the DB which synchronised fine and I can see that what I upload is in the DB and its in the favicon/website/1/ directory.
Anyway, I tried the .htaccess stuff, creating the test.txt file and it loaded fine in all directory references from pub down to the favicon directory.
I could only find a .htaccess file in pub and pub/media and have removed both.
Is there a step I've missed once the .htaccess file is removed:
Should I be flushing the cache like this sudo bin/magento cache:flush
Do I need to setup:compile or setup:upgrade or restart apache?
Or is there some other Admin setting I've missed that needs to be set or that I could try?
This issue is really dragging on so any hints/help would be much appreciated.
at my end i have memory limit and max execution time problem
memory_limit = 2048M
max_execution_time = 9990000
max_input_vars = 20000
it's nassacry setting in m2