Jump to content

CMS images can't be displayed unless .htaccess file is deleted


Recommended Posts

I have uploaded an image via editor for a cms page. The image is is uploaded and I can see it in the folder /img/cms/. But the image won't show up even though the path is correct.

 

There is a .htaccess file in the folder img/cms/ containing the line

php_flag engine off

If I delete the .htaccess file the image shows up correctly.

 

What it the command php_flag engine off for and is it save to delete the .htaccess file?

 

Link to comment
Share on other sites

Hey,

 

Thank you for your feedback, please do not remove this file, it's actually here to improve security.

 

This .htaccess directive is here to prevent anyone from running a PHP script in that folder.

However after researching, it appears that it may generate some sides effects.

 

Please can you try to replace the content of this .htaccess by the following:

<IfModule mod_php5.c> 
   # Turn the PHP engine off 
   php_flag engine off 
</IfModule>

Let us know if this helps, else we will be glad to assist you.

 

It would also be interesting to know which hosting provider you have.

 

Regards,

  • Like 6
Link to comment
Share on other sites

Thank you for your response and the code. I have inserted the suggested code in the .htaccess file and now the image appears with .htaccess file in the folder.

 

The site is on an own root server with Hetzner. The server is running with PHP Version 5.4.9-4ubuntu2.3. Could it be that the reason for the error was that PHP is running as CGI?

Edited by prestamax (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 5 weeks later...

This works also for me in case of displaying images but I observed another issue:

 

Depending on browser kind and version thumbnail images in file manager are displaying correctly or not.

I discover that in some browsers images are not displaying because path to thumbnail images is changing from 

img/tmp/cms/

to

youradminfoldername/img/tmp/cms/

 

which of course not exist

 

by "youradminfoldername" I mean admin folder name to login to BO

 

 

presta 1.6.0.5

example browsers:

Opera 12.12 - images displaying correctly (path to thumb: img/tmp/cms/)

Firefox 12.0 - images not displaying (path to thumb: youradminfoldername/img/tmp/cms/)

 

Any idea what could be the reason?

Edited by tmk (see edit history)
  • Like 1
Link to comment
Share on other sites

  • 1 month later...

This works also for me in case of displaying images but I observed another issue:

 

Depending on browser kind and version thumbnail images in file manager are displaying correctly or not.

I discover that in some browsers images are not displaying because path to thumbnail images is changing from 

img/tmp/cms/

to

youradminfoldername/img/tmp/cms/

 

which of course not exist

 

by "youradminfoldername" I mean admin folder name to login to BO

 

 

presta 1.6.0.5

example browsers:

Opera 12.12 - images displaying correctly (path to thumb: img/tmp/cms/)

Firefox 12.0 - images not displaying (path to thumb: youradminfoldername/img/tmp/cms/)

 

Any idea what could be the reason?

 

I have the same issue now, in Chrome works perfectly, but in Safari it adds /youradminfoldername/ to my path.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

Hey,

 

Thank you for your feedback, please do not remove this file, it's actually here to improve security.

 

This .htaccess directive is here to prevent anyone from running a PHP script in that folder.

However after researching, it appears that it may generate some sides effects.

 

Please can you try to replace the content of this .htaccess by the following:

<IfModule mod_php5.c> 
   # Turn the PHP engine off 
   php_flag engine off 
</IfModule>

Let us know if this helps, else we will be glad to assist you.

 

It would also be interesting to know which hosting provider you have.

 

Regards,

Hi, 

 

Still I have a same problem, any way I can fix it please.?

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 4 months later...

hello,

I have the same problem - the images are not shown... in all browsers

I tried to change the code in htaccess.. but the problem persists..

 COuld you please advice how to resolve?

 

Thanks


Hey,

 

Thank you for your feedback, please do not remove this file, it's actually here to improve security.

 

This .htaccess directive is here to prevent anyone from running a PHP script in that folder.

However after researching, it appears that it may generate some sides effects.

 

Please can you try to replace the content of this .htaccess by the following:

<IfModule mod_php5.c> 
   # Turn the PHP engine off 
   php_flag engine off 
</IfModule>

Let us know if this helps, else we will be glad to assist you.

 

It would also be interesting to know which hosting provider you have.

 

Regards,

hello,

I have the same problem - the images are not shown... in all browsers

I tried to change the code in htaccess.. but the problem persists..

 COuld you please advice how to resolve?

 

Thanks

Link to comment
Share on other sites

hello,

I have the same problem - the images are not shown... in all browsers

I tried to change the code in htaccess.. but the problem persists..

 COuld you please advice how to resolve?

 

Thanks

hello,

I have the same problem - the images are not shown... in all browsers

I tried to change the code in htaccess.. but the problem persists..

 COuld you please advice how to resolve?

 

Thanks

I see that the path to the image is not correct. Prestashop insert also the language (es.sitename/en/content).. how can I make in order the path becom correct? somebody knows?

Link to comment
Share on other sites

×
×
  • Create New...