Forums / Installing on a Linux/Unix Server / No images after fresh installation on bravenet server

No images after fresh installation on bravenet server

Views: 8,686

Results 21 to 25 of 25
16 Jul 2016, 7:59 AM
#21
jpirie avatar

jpirie

New Zenner

Join Date:
Apr 2015
Location:
Assynt, North West Highlands of Scotland
Posts:
24
Plugin Contributions:
0

No images after fresh installation on bravenet server

mc12345678:

If by line 6 you mean:

define('[B]HTTPS[/B]_SERVER', 'https://localhost');


Yes, sorry, I was disregarding the first line of the scipt  ```
/**
``` The https:// part has to have it's 's' removed to make the site work at all...even as a fresh install which it is at present just using the defaults, I have not had time to add a template since upgrading the site and hitting this problem again.  The site is located here 

[http://www.shake-the-tree.com/shop/](http://shake-the-tree.com)

> Then, I would definitely do a review of the code used on your site, because with ENABLE_SSL as false, this line/definition should not even be considered or used throughout the site. Swapping to the default ZC template should show you how the pages should be accessed (all http:), and it is likely/possible that the current template does something to always use https:...

How do I carry out a review of the code?  Is that part of the instructions at the start of this thread?

Thanks for your continued interest.  By and large [https://www.eukhost.com/](https://www.eukhost.com/) have been very good over the years I have used them and, I do only pay for a shared server so perhaps this is the issue, but I am sensing that I am digging a little too deeply here for their comfort!  We may need to move the E.Commerce site to another host if I cannot get to the bottom of this one :)

James
16 Jul 2016, 9:53 AM
#22
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: No images after fresh installation on bravenet server

jpirie:

Yes, sorry, I was disregarding the first line of the scipt ```
/**

> 
> [http://www.shake-the-tree.com/shop/](http://shake-the-tree.com)
> 
> 
> 
> How do I carry out a review of the code?  Is that part of the instructions at the start of this thread?
> 
> Thanks for your continued interest.  By and large <https://www.eukhost.com/> have been very good over the years I have used them and, I do only pay for a shared server so perhaps this is the issue, but I am sensing that I am digging a little too deeply here for their comfort!  We may need to move the E.Commerce site to another host if I cannot get to the bottom of this one :)
> 
> James

OK, so here is what I have from looking at/through the Web facing part of your store, which seems odd.

Your base href tag which is assigned in includes/templates/responsive_classic/common/html_header.php is coming back as https:. In a default/unmodified site this is because $request_type indicates 'SSL'. The variable $request_type is assigned during the page load in includes/init_includes/init_file_db_name.php unless it is overridden (which could be the case?). It is assigned 'SSL' if any of the following conditions (between double pipe characters ||) is true.

((isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on' || $_SERVER['HTTPS'] == '1'))) ||
(isset($_SERVER['HTTP_X_FORWARDED_BY']) && strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_BY']), 'SSL') !== false) ||
(isset($_SERVER['HTTP_X_FORWARDED_HOST']) && (strpos(strtoupper($_SERVER['HTTP_X_FORWARDED_HOST']), 'SSL') !== false || strpos(strtolower($_SERVER['HTTP_X_FORWARDED_HOST']), str_replace('https://', '', HTTPS_SERVER)) !== false)) ||
(isset($_SERVER['HTTP_X_FORWARDED_SERVER']) && strpos(strtolower($_SERVER['HTTP_X_FORWARDED_SERVER']), str_replace('https://', '', HTTPS_SERVER)) !== false) ||
(isset($_SERVER['SCRIPT_URI']) && strtolower(substr($_SERVER['SCRIPT_URI'], 0, 6)) == 'https:') ||
(isset($_SERVER['HTTP_X_FORWARDED_SSL']) && ($_SERVER['HTTP_X_FORWARDED_SSL'] == '1' || strtolower($_SERVER['HTTP_X_FORWARDED_SSL']) == 'on')) ||
(isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'ssl' || strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https')) ||
(isset($_SERVER['HTTP_SSLSESSIONID']) && $_SERVER['HTTP_SSLSESSIONID'] != '') ||
(isset($_SERVER['HTTP_X_FORWARDED_PORT']) && $_SERVER['HTTP_X_FORWARDED_PORT'] == '443') ||
(isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == '443')


As can be seen, these are server side "settings", so if any of these are incorrectly set to return true, then that can be an issue and likely explains what is observed.

To correct your issue, which does appear to be server related you could modify includes/templates/YOUR_TEMPLATE/common/html_header.php to account for you not enabling SSL, and that should resolve the issue for website visitors, but doesn't solve the underlying problem which is the server's configuration. The way the default ZC template is setup and installation check(s) are setup help to identify this issue, but if it can't be corrected, yes would suggest a change in hosting arrangement. Thing is, if they can't setup their shared server correctly, what's to say that they could setup a "hosted" or dedicated server correctly?

The change needed in html_header would be to modify:
<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" /> ``` To: ``` <base href="<?php echo (($request_type == 'SSL' [b]&& ENABLE_SSL == 'true'[/b]) ? HTTPS_SERVER . DIR_WS_HTTPS_CATALOG : HTTP_SERVER . DIR_WS_CATALOG ); ?>" /> ```

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

16 Jul 2016, 10:34 AM
#23
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: No images after fresh installation on bravenet server

jpirie:

Yes, sorry, I was disregarding the first line of the scipt ```
/**

> 
> [http://www.shake-the-tree.com/shop/](http://shake-the-tree.com)
> 
> 
> 
> How do I carry out a review of the code?  Is that part of the instructions at the start of this thread?
> 
> Thanks for your continued interest.  By and large <https://www.eukhost.com/> have been very good over the years I have used them and, I do only pay for a shared server so perhaps this is the issue, but I am sensing that I am digging a little too deeply here for their comfort!  We may need to move the E.Commerce site to another host if I cannot get to the bottom of this one :)
> 
> James

Looking back at the support offered by lhungil, it would appear that "code" that could be reviewed to identify the server "configuration" issue, would be basically at the end of the phpinfo() results where the _SERVER related data is/would be provided... That information could be reviewed to identify which "factor" is triggering $request_type to be set as 'SSL' for all links. Whichever piece of information it is that is evaluating to true, could be modified to also coincide with the use of ENABLE_SSL such that if ENABLE_SSL were false, then that particular "answer" would/could be considered false as well...

Otherwise, the code review to which I was speaking (not exactly applicable if using a default file installation of ZC code) was like what I did in finding html_header.php and init_file_db_name.php as sources for the observed condition.  "Easiest" way to find modifications to such code is to use some sort of code compare utility, though in the absence of that, I have found that I can work around file comparisons by using standard "desktop" software such as Word where it is possible to compare two documents.  But, having said that, I do not suggest copying from Word to your web-page as it adds additional "formatting" characters that tend to scramble how things look.  Just to use it as the tool that is needed. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

31 Jul 2016, 2:33 PM
#24
jpirie avatar

jpirie

New Zenner

Join Date:
Apr 2015
Location:
Assynt, North West Highlands of Scotland
Posts:
24
Plugin Contributions:
0

Re: No images after fresh installation on bravenet server

Hey
mc12345678.. Your Private Message box is full :)

Better do some reading ;)

James

31 Jul 2016, 3:44 PM
#25
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: No images after fresh installation on bravenet server

jpirie:

Hey
mc12345678.. Your Private Message box is full :)

Better do some reading ;)

James

Yeah saw that earlier. Have items saved for various reasons. Made a small amount of room. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...