cancel
Showing results for 
Search instead for 
Did you mean: 

Images are not showing after moving to live server

Images are not showing after moving to live server

Dear people,

 

I installed Magento 2 locally. Because loading the pages were too slow I moved then on live server. It is now too fast, but I miss favicon, logo and some other images. They are not showing. Standard Magento images are showing, but the images which I uploaded are not. It may be this configuration, but I do not know what to fill in.

 

magento-2-web-screenshot.png

My question is:

1. Why do I miss the images on Live server, but they are showing on local server?

2. What can I fill in the empty field in de picture (for static and media)?

 

Thank you in advance,

Regards,

Navid

 

10 REPLIES

Re: Images are not showing after moving to live server

Hi @AnaV 

 

Did you run the following comon your live server? 

 

php bin/magento setup:static-content:deploy 

You should also make sure that your deploy mode is set to production so the errors and logs are not shown to your end user. When you switch mode to production, Magento automatically deploys all of the themes, images and static files. 

 

You can check the deploy mode by running: 

 

php bin/magento deploy:mode:show

and set your deploy mode to production by running: 

 

php bin/magento deploy:mode:set production

 

I hope it helps. 

 

Please let me know if you have any questions/ 

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post

Re: Images are not showing after moving to live server

Hi,

Thank you for your reply. On local server I followed those steps and then I put them live. The problem is, that I have shared hosting and I do not have SSH to run those commands Smiley Sad. And If i try to put the local website in Production mode, then I get some error (some thing with rmdir).

Is there any possibility to run all these commands without SSH?

 

Thank you in advance,

Navid

Re: Images are not showing after moving to live server

Right that makes sense now. You need ssh access to run those commands but my questions is, why are you runnning M2 on a shared hosting? I am sure it's not safe enough and you won't get the best M2 performance. 


Secondly, since you don't have SSH access so the system can't create the symlinks that are needed to display the static content on frontend. In my opinion, the best option is to speak to your hosting provider and ask them whether they can give you a temporary access. 

 

Alternatively, you could also use the CPanel symlink page to create symlinks. 

 

I hope that helps. 

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post

Re: Images are not showing after moving to live server

I shall contact the hosting. But they have no possibility to give me SSH access. I Just put the magento mode in Production followed by compilation en deployment, on local server.

 

Because the local server is too slow. I put the site live, there is too fast, thanks to SSD possibility of the hosting.

 

Thank you for the information.

 

 

Re: Images are not showing after moving to live server

@anmiraj

 

No worries. You're welcome. 

 

Please accept the answer as a solution if I was able to help you. 


Thanks

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post

Re: Images are not showing after moving to live server


anmiraj wrote:

I shall contact the hosting. But they have no possibility to give me SSH access. 


Well it seems weird for them to not be able to provide you with SSH Access. 

 

Unfortunately it will be quite inconvenient for you to develop and manage a Magento 2 store without SSH Access. 

 

Some hosting providers may ask for a Photo ID or other verification documents before they grant you with SSH Access. Can you check with them on whether this is possible? 

James Lee | Moderator • Magento Master
See My Recommended Magento Hosting & Security Tips

Re: Images are not showing after moving to live server

I shall take my site to another server.

 

The hosting told me to put the magento in production mode, compile en deploy it locally en put it then live. We try to take care the rest with cron.

 

They said also we have some shops with Magento 2 on our servers and they do the same.

 

I put the Magento in production Mode en compiled en deployed it en put them live, but still I miss images on frontpage (logo en favicon are not showing)

 For example, the logo stands at: pub/media/logo/stores/1/logo_2.png, but when I want to access it via: https://www.[domainname]/pub/media/logo/stores/1/logo_2.png, I get 'Internal server error'

Re: Images are not showing after moving to live server

@anmiraj I think it's best to move to another server then. I doubt that you'd get SSH access on a shared server so it's worth going for a VPS at least. 

Magento Certified Solution Specialist | Lead Magento developer
If this response was helpful to you, consider giving kudos to this post

Re: Images are not showing after moving to live server


anmiraj wrote:

 

 I put the Magento in production Mode en compiled en deployed it en put them live, but still I miss images on frontpage (logo en favicon are not showing)

 For example, the logo stands at: pub/media/logo/stores/1/logo_2.png, but when I want to access it via: https://www.[domainname]/pub/media/logo/stores/1/logo_2.png, I get 'Internal server error'


If accessing the image files directly is throwing up an Internal Server Error, this seems like a server related problem somewhere. 

 

Did you check this with them? You don't have to bring up the Magento problems and just tell them that the images direct link is throwing up the error. 

James Lee | Moderator • Magento Master
See My Recommended Magento Hosting & Security Tips