Zen Cart Logo
Forums / General Questions / Admin not accessible

Admin not accessible

Views: 3,423

Results 21 to 40 of 41
3 Dec 2017, 4:14 PM
#21
mc12345678 avatar

mc12345678

Totally Zenned

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

Admin not accessible

mc12345678:

When say no difference, does that mean that the front/catalog side STILL works, still DOESN'T work? The Admin STILL doesn't work? Does that mean that the same mydebug-adm file is being generated or is there different content?

If the catalog works but the admin does not, and there are no error messages about the catalog side timezone setting, then would again take a look at includes/extra_configures/set_time_zone.php as well as admin/includes/extra_configures/set_time_zone.php to see if/what difference there is.

Also, would apply the above suggested htaccess modification to the admin/.htaccess file, try again, and report results.

The other possible .htaccess entry to help this situation that has been found would be:

SetEnv TZ Africa/Johannesburg

Again would suggest placing it in your newly created catalog .htaccess file first, then work from there. Though there are a number of things that may need to be reviewed based on the above suggestion(s).

3 Dec 2017, 4:25 PM
#22
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

When say no difference, does that mean that the front/catalog side STILL works, still DOESN'T work? The Admin STILL doesn't work? Does that mean that the same mydebug-adm file is being generated or is there different content?

The site works, but admin doesn't

mc12345678:

If the catalog works but the admin does not, and there are no error messages

Are error message on the admin site, but I am experiencing really slow loads on the logs for some reason from my location

mc12345678:

about the catalog side timezone setting, then would again take a look at includes/extra_configures/set_time_zone.php as well as admin/includes/extra_configures/set_time_zone.php to see if/what difference there is.

Looking at it now - will add the same string there too...

mc12345678:

Also, would apply the above suggested htaccess modification to the admin/.htaccess file, try again, and report results.

will do

3 Dec 2017, 4:31 PM
#23
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

Also, would apply the above suggested htaccess modification to the admin/.htaccess file, try again, and report results.

Where to insert in this file

#
# @copyright Copyright 2003-2013 Zen Cart Development Team
# @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
# @version GIT: $Id: Author: DrByte  Sat Dec 21 17:00:00 2013 -0500 Modified in v1.5.3 $
#
# This is used with Apache WebServers
#
# The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
# It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
# Will also prevent people from seeing what is in the dir. and any sub-directories
#
# For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
# Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified.
# Example:
#<Directory "/usr/local/apache/htdocs">
#  AllowOverride Limit Options Indexes
#</Directory>
###############################
DirectoryIndex index.php

# deny *everything*
<FilesMatch ".*\..*">
  Order Allow,Deny
  Deny from all
</FilesMatch>

# but now allow just *certain* necessary files:
<FilesMatch "(?i).*\.(php|js|css|html?|ico|otf|jpe?g|gif|webp|png|swf|flv|xml|xsl)$">
  Order Allow,Deny
  Allow from all
</FilesMatch>

IndexIgnore */*

<limit POST PUT>
order deny,allow
deny from All
</limit>


## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
# OPTIONS -Indexes -ExecCGI



##################
## Optional caching improvements
## Requires mod_header and mod_deflate to be enabled within Apache
##################
<IfModule mod_headers.c>
  Header unset Pragma
  FileETag None
  Header unset ETag
  #Header set Cache-Control "no-transform"
  <FilesMatch "(?i).*\.(ico|jpe?g|gif|otf|webp|png|swf|flv|svg|svgz)$">
    Header set Cache-control "max-age=864000, public, must-revalidate"
    Header unset Last-Modified
  </FilesMatch>
  <FilesMatch "(?i).*\.(html|htm|xml|txt|xsl)$">
    Header set Cache-control "max-age=7200, must-revalidate"
  </FilesMatch>
</IfModule>
<IfModule mod_deflate.c>
  <FilesMatch "(?i)\.(js|css)$">
    SetOutputFilter DEFLATE
  </FilesMatch>
</IfModule>

##################
## Optional improvements
## Requires mod_expires to be enabled within Apache
##################
<ifmodule mod_expires.c>
  ExpiresActive On
  ExpiresDefault A300
  ExpiresByType application/x-javascript A3600
  ExpiresByType text/css A3600
  ExpiresByType image/gif A604800
  ExpiresByType video/x-flv A604800
  ExpiresByType application/pdf A604800
  ExpiresByType text/html A300
  ExpiresByType image/x-icon A86400
  ExpiresByType image/jpeg A2592000
  ExpiresByType image/png A2592000
  ExpiresByType text/cache-manifest "access plus 0 seconds"

</ifmodule>


#turn off X-PHP-Originating-Script header when sending emails from admin
#uncomment to activate:
# php_flag mail.add_x_header Off
3 Dec 2017, 4:38 PM
#24
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

If the catalog works but the admin does not, and there are no error messages about the catalog side timezone setting, then would again take a look at includes/extra_configures/set_time_zone.php as well as admin/includes/extra_configures/set_time_zone.php to see if/what difference there is..

<?php
/**
 * @package admin
 * @copyright Copyright 2003-2013 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
 */
// get time zone settings from catalog-side file
include (DIR_FS_CATALOG . '/includes/extra_configures/set_time_zone.php');

This points to the directory/file with the time zone setting Africa/Johannesburg. Would I add that string to the file that I find there which is my_renamed_admin/includes/extra_configures/use_catalog_time_zone.php?

 $TZ = 'Africa/Johannesburg';  // eg: 'Europe/Oslo'  
3 Dec 2017, 4:44 PM
#25
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

The other possible .htaccess entry to help this situation that has been found would be:

SetEnv TZ Africa/Johannesburg


added - cleared browser cache, no admin...

> **mc12345678:**
>
> Again would suggest placing it in your newly created catalog .htaccess file first, then work from there.  Though there are a number of things that may need to be reviewed based on the above suggestion(s).

that's done with the same result:

php_value date.timezone 'Africa/Johannesburg'

SetEnv TZ Africa/Johannesburg

3 Dec 2017, 7:38 PM
#26
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Admin not accessible

If going to try in the admin/.htaccess file then outside of a group of commands and not on the same line as being commented out. End of file is fine.

As to the SetEnv characteristic, it dawned on me that if that is able to execute satisfactorily then back in the set_time_zone.php file, leave the putenv row commented out, but uncomment the line that follows where it sets $TZ = @ something...

Basically the htaccess command sets the environment variable that is intended to be set by putenv, and if putenv is disabled for the server, but the htaccess can set the environment variable then so be it.

Good, the admin version of the file is as it should be.

4 Dec 2017, 2:57 AM
#27
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

If going to try in the admin/.htaccess file then outside of a group of commands and not on the same line as being commented out. End of file is fine.

Done - admin not accessible

mc12345678:

As to the SetEnv characteristic, it dawned on me that if that is able to execute satisfactorily then back in the set_time_zone.php file, leave the putenv row commented out, but uncomment the line that follows where it sets $TZ = @ something...

I have just found something duplicated in the string that is meant to be commented out:

<?php
/**
 * @package initSystem
 * @copyright Copyright 2003-2013 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: DrByte  Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $
 */
/*
 * Set time zone
*/
if (version_compare(PHP_VERSION, 5.3, '>='))
{
  // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php
  $TZ = 'Africa/Johannesburg';  // eg: 'Europe/Oslo'



  /**
   * MAKE NO CHANGES BELOW THIS LINE
   *
   * The following will take the timezone you specified above and apply it in your store.
   * If you didn't specify one, it will try to use the setting from your server's PHP configuration
   */
  if ($TZ == '') {
    $TZ = date_default_timezone_get();
  }
  if ($TZ != '') {
    //putenv('TZ=' . $TZ);
    //@date_default_timezone_set($TZ);
  }
}

mc12345678:

Basically the htaccess command sets the environment variable that is intended to be set by putenv, and if putenv is disabled for the server, but the htaccess can set the environment variable then so be it.

Good, the admin version of the file is as it should be.

4 Dec 2017, 1:30 PM
#28
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,100
Plugin Contributions:
56

Re: Admin not accessible

Parafanaylya:

Done - admin not accessible

I have just found something duplicated in the string that is meant to be commented out:

<?php /** * @package initSystem * @copyright Copyright 2003-2013 Zen Cart Development Team * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * @version GIT: $Id: Author: DrByte Sat Nov 2 01:21:28 2013 -0400 New in v1.5.2 $ */ /* * Set time zone */ if (version_compare(PHP_VERSION, 5.3, '>=')) { // put your timezone here. Refer to http://www.php.net/manual/en/timezones.php $TZ = 'Africa/Johannesburg'; // eg: 'Europe/Oslo' /** * MAKE NO CHANGES BELOW THIS LINE * * The following will take the timezone you specified above and apply it in your store. * If you didn't specify one, it will try to use the setting from your server's PHP configuration */ if ($TZ == '') { $TZ = date_default_timezone_get(); } if ($TZ != '') { //putenv('TZ=' . $TZ); //@date_default_timezone_set($TZ); } } ``` Why are those two lines commented-out? Those are the lines of code that are actually setting the timezone to the value you identified.
4 Dec 2017, 1:54 PM
#29
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Admin not accessible

lat9:

Why are those two lines commented-out? Those are the lines of code that are actually setting the timezone to the value you identified.

What?! having difficulty following an issue that spans at least 2 if not three threads? :P

The "cause" of that being commented out was this action/post: https://www.zen-cart.com/showthread.php?223146-Blank-site-after-installing-using-Plesk-control-panel&p=1338555#post1338555

and then:
https://www.zen-cart.com/showthread.php?223161-putenv-and-set_time_zone-php a now closed thread which supposedly carried over to github, though I don't see any reference to it directly in the code blame history nor as a new issue, though I see this closed issue that seems like it aligns: https://github.com/zencart/zencart/issues/1557.

Whether it remains necessary to still be commented out has been the dance...

Something got modified on the host (again?) to remove whatever fix had been put into place to support continued operation or to cause a new alternate issue. There appears to be no full backup by which to compare, and while the proposed change remains in place (commenting out the putenv related code), the original issue remains.

4 Dec 2017, 2:43 PM
#30
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Admin not accessible

have you turned on debug as well as error reporting? will hopefully point to the exact problem....

with regards to the code history as well as "blame", my PR was to help with debugging problems, not to specifically address a putenv statement.

i would have the OP turn on error_reporting as well as debug. and the last time i was involved, i thought the OP was moving hosts to specifically address the putenv statement as well as allow for individual php.ini files for virtual hosts.

best.

4 Dec 2017, 5:06 PM
#31
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Admin not accessible

carlwhat:

have you turned on debug as well as error reporting? will hopefully point to the exact problem....

with regards to the code history as well as "blame", my PR was to help with debugging problems, not to specifically address a putenv statement.

i would have the OP turn on error_reporting as well as debug. and the last time i was involved, i thought the OP was moving hosts to specifically address the putenv statement as well as allow for individual php.ini files for virtual hosts.

best.

Blame as it relates to github is a specific historical view of the files allowing one to see/back track the history of a section of code and identify (by blame) who/what modified a portion of code. Further as each backwards review takes one to a commit there may have been notes left at any such location. I did that type of review just in case and did not find any comments/conversation related to the putenv code that had been applied to the commits.

Further, as there was no link provided to identify where on github the conversation was carried forward (possibly because the thread was closed faster than able to apply the link), a search was performed to see what comments/issues might have been made to apply to the putenv related code that was being discussed as an issue. The link mentioned was discovered and posted to try to get these issues and history together.

4 Dec 2017, 5:50 PM
#32
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

I'm here - just going through my backups - I have a DB back up of 16 November, and another of 24 November. The former excludes any changes made and I'm going to run with that for now.

4 Dec 2017, 6:19 PM
#33
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

carlwhat:

have you turned on debug as well as error reporting? will hopefully point to the exact problem....

Where would one toggle the above?

carlwhat:

with regards to the code history as well as "blame", my PR was to help with debugging problems, not to specifically address a putenv statement.

i would have the OP turn on error_reporting as well as debug. and the last time i was involved, i thought the OP was moving hosts to specifically address the putenv statement as well as allow for individual php.ini files for virtual hosts.

best.

Nope - I wasn't moving hosts for any other reason than to have support. I have experienced support issues with our previous service providers.

4 Dec 2017, 6:59 PM
#34
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Admin not accessible

Parafanaylya:

I'm here - just going through my backups - I have a DB back up of 16 November, and another of 24 November. The former excludes any changes made and I'm going to run with that for now.
This is a file issue not a database issue. Introducing an old backup of the database without identifying a need for it could introduce other problems. Try to stay on one issue.

Whether it is to restore the file that had been modified to originally allow access to the admin for a short period of time or if it is to apply other debug techniques just asked about, but really discourage throwing in another potential issue.

4 Dec 2017, 7:16 PM
#35
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Admin not accessible

#1 - i agree with regards to backups. leave the system as is.
#2 - catalog side works fine.... admin side does not. to turn on debugging for the admin, change this file as follows:

YOUR_ADMIN/includes/application_top.php

around line 20.

//FROM:
if (!defined('DEBUG_AUTOLOAD')) define('DEBUG_AUTOLOAD', false);
//TO:
if (!defined('DEBUG_AUTOLOAD')) define('DEBUG_AUTOLOAD', true);
define('STRICT_ERROR_REPORTING', true);

#3 - if you have NOT moved hosts, i would "guess" your problem is in:

YOUR_ADMIN/currency_cron.php

and specifically:

//FROM:
putenv($_SERVER["argv"][$i]);
//TO:
//putenv($_SERVER["argv"][$i]);

although i could be wrong.

my suggestion in option 2 should point you to the correct place, assuming YOUR_ADMIN/includes/configure.php

is correct.

best.

4 Dec 2017, 7:16 PM
#36
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

mc12345678:

This is a file issue not a database issue. Introducing an old backup of the database without identifying a need for it could introduce other problems. Try to stay on one issue.

DB restored to current from backup

and the admin panel is working! My host changed php to 7.0

mc12345678:

Whether it is to restore the file that had been modified to originally allow access to the admin for a short period of time or if it is to apply other debug techniques just asked about, but really discourage throwing in another potential issue.

4 Dec 2017, 7:18 PM
#37
carlwhat avatar

carlwhat

zennedOut

Join Date:
Nov 2005
Location:
los angeles
Posts:
2,965
Plugin Contributions:
8

Re: Admin not accessible

Parafanaylya:

DB restored to current from backup

and the admin panel is working! My host changed php to 7.0

my guess is that the php 7.0 was the solution.

4 Dec 2017, 7:26 PM
#38
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

@mc12345678 & carlwhat - you guys are great in dealing with this layman who keeps dipping his own shoes into the sticky stuff:blush:

I don't know what happened, but the admin is working again.

Is there anything you want to have a look at directly to try figure out where I screwed up?

4 Dec 2017, 7:33 PM
#39
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

carlwhat:

have you turned on debug as well as error reporting? will hopefully point to the exact problem....

debugs

[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
[04-Dec-2017 19:19:13 UTC] PHP Warning: mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO) in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/includes/classes/db/mysql/query_factory.php on line 62
anything else?

4 Dec 2017, 7:43 PM
#40
parafanaylya avatar

parafanaylya

Totally Zenned

Join Date:
Jul 2005
Location:
Hoedspruit
Posts:
470
Plugin Contributions:
1

Re: Admin not accessible

and this error log extract for today

Mon Dec 04 10:11:52 2017] [warn] [client 105.226.120.117] mod_fcgid: stderr: PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/my_admin/login.php on line 13
[Mon Dec 04 10:13:30 2017] [error] [client 66.249.69.228] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/robots.txt
[Mon Dec 04 10:14:41 2017] [error] [client 105.226.120.117] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/apple-touch-icon-precomposed.png
[Mon Dec 04 10:14:41 2017] [error] [client 105.226.120.117] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/apple-touch-icon.png
[Mon Dec 04 10:56:22 2017] [error] [client 40.77.167.118] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/robots.txt
[Mon Dec 04 11:13:03 2017] [error] [client 68.180.230.227] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/robots.txt
[Mon Dec 04 11:13:31 2017] [error] [client 66.249.69.230] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/download/gb1800ss.pdf
[Mon Dec 04 11:36:36 2017] [error] [client 100.43.85.119] File does not exist: /var/www/vhosts/joburlnx.ehost-services221.com/joburgonline.com/robots.txt