Zen Cart Logo
Forums / Basic Configuration / Can't access admin section after changing DB password

Can't access admin section after changing DB password

Views: 4,689

Results 1 to 20 of 35
6 Oct 2015, 1:10 AM
#1
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Can't access admin section after changing DB password

I had to change my DB password today and i changed it in 2 places - includes/configure.php and admin/includes/configure.php. My site works fine - http://swordsofhonor.com - but the admin brings up a blank screen. i changed the file and uploaded via ws_ftp and then i also went into the cpanel file manager and edited there - just in case there was something wrong with the file upload via ws_ftp. what could be wrong?

6 Oct 2015, 1:16 AM
#2
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Can't access admin section after changing DB password

lidlchris:

I had to change my DB password today and i changed it in 2 places - includes/configure.php and admin/includes/configure.php. My site works fine - http://swordsofhonor.com - but the admin brings up a blank screen. i changed the file and uploaded via ws_ftp and then i also went into the cpanel file manager and edited there - just in case there was something wrong with the file upload via ws_ftp. what could be wrong?

Are there any files generated in your /logs folder?

6 Oct 2015, 1:38 AM
#3
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

Also, after editing were both files opened to validate that the changes were saved? (Permissions the file may have prevented saving the change(s) and should be verified to be 644 before making the change and then at highest of 444 after the change to prevent inadvertent modification and for other potential reasons.)

6 Oct 2015, 1:40 AM
#4
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Can't access admin section after changing DB password

Just dawned on me

Is there any spaces BEFORE the starting <?php in the YOUR_ADMIN/includes/configure.php

using cpanel to edit does weird things

6 Oct 2015, 1:46 AM
#5
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

bislewl:

Are there any files generated in your /logs folder?

yes lots of files...

6 Oct 2015, 1:47 AM
#6
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

mc12345678:

Also, after editing were both files opened to validate that the changes were saved? (Permissions the file may have prevented saving the change(s) and should be verified to be 644 before making the change and then at highest of 444 after the change to prevent inadvertent modification and for other potential reasons.)

i verfied changes by looking in cpanel/file manager.. permissions is set to 644 - i'll change it back to 444 now

6 Oct 2015, 1:50 AM
#7
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

bislewl:

Just dawned on me

Is there any spaces BEFORE the starting <?php in the YOUR_ADMIN/includes/configure.php

using cpanel to edit does weird things

no spaces.. in editing in cpanel, it asks what 'character encoding' to use and the default is utf-8 - i left it to the default of utf-8

6 Oct 2015, 1:50 AM
#8
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

lidlchris:

yes lots of files...

all of the files are older though..

6 Oct 2015, 1:52 AM
#9
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

lidlchris:

all of the files are older though..

i take that back... looking in ws_ftp it only showed older files. but in cpanel/file manager there are lots of files today

6 Oct 2015, 1:54 AM
#10
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

bislewl:

Are there any files generated in your /logs folder?

here are the first 2 files i opened - both created in the last hour:

[05-Oct-2015 19:08:56 America/Denver] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3065480185 bytes) in /home/honor/public_html/includes/functions/html_output.php on line 79

[05-Oct-2015 18:15:37 America/Denver] PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED :: select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' in /home/honor/public_html/includes/classes/db/mysql/query_factory.php on line 120

6 Oct 2015, 1:58 AM
#11
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

lidlchris:

i take that back... looking in ws_ftp it only showed older files. but in cpanel/file manager there are lots of files today

Most recent should be a good place to start. If posting the contents, please be sure your admin folder name remains unknown to everyone publicly (ie. Change the posted content to just admin) and also please place between ```
[CODE] and [/CODE]

6 Oct 2015, 1:59 AM
#12
bislewl avatar

bislewl

Totally Zenned

Join Date:
Dec 2011
Location:
Wisconsin, USA
Posts:
674
Plugin Contributions:
12

Re: Can't access admin section after changing DB password

lidlchris:

i take that back... looking in ws_ftp it only showed older files. but in cpanel/file manager there are lots of files today

My guess is there were greater than the limit usually that's around 10,000 you can usually delete the old ones. What is the oldest one that starts out with:
myDEBUG-adm-

6 Oct 2015, 2:05 AM
#13
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

bislewl:

My guess is there were greater than the limit usually that's around 10,000 you can usually delete the old ones. What is the oldest one that starts out with:
myDEBUG-adm-

all of the ones that start out with myDEBUG-adm- say the same thing:
[05-Oct-2015 18:15:26 America/Denver] PHP Fatal error: 0:DB_ERROR_NOT_CONNECTED :: select * from zen_project_version WHERE project_version_key = 'Zen-Cart Database' in /home/honor/public_html/includes/classes/db/mysql/query_factory.php on line 120

i don't think i've included my admin name in any of these post?? hopefully not..

6 Oct 2015, 2:07 AM
#14
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

bislewl:

My guess is there were greater than the limit usually that's around 10,000 you can usually delete the old ones. What is the oldest one that starts out with:
myDEBUG-adm-

must be going crazy.. i only changed the DB_SERVER_PASSWORD in those 2 files to the same new password.. i can't post the file here and can't post the admin link either right?

6 Oct 2015, 2:10 AM
#15
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

mc12345678:

Most recent should be a good place to start. If posting the contents, please be sure your admin folder name remains unknown to everyone publicly (ie. Change the posted content to just admin) and also please place between ```
[CODE] and [/CODE]


here is the contents..  hopefully i removed all of the admin name:
<?php/** * @package Configuration Settings circa 1.5.1 * @copyright Copyright 2003-2012 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0 * File Built by zc_install on 2013-01-22 04:08:05 *//*************** NOTE: This file is similar, but DIFFERENT from the "store" version of configure.php. ***********//*************** The 2 files should be kept separate and not used to overwrite each other. ***********//** * WE RECOMMEND THAT YOU USE SSL PROTECTION FOR YOUR ENTIRE ADMIN: * To do that, make sure you use a "https:" URL for BOTH the HTTP_SERVER and HTTPS_SERVER entries: */ define('HTTP_SERVER', 'http://www.swordsofhonor.com'); define('HTTPS_SERVER', 'http://www.swordsofhonor.com'); define('HTTP_CATALOG_SERVER', 'http://www.swordsofhonor.com'); define('HTTPS_CATALOG_SERVER', 'http://www.swordsofhonor.com'); // secure webserver for admin? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_ADMIN', 'true'); // secure webserver for storefront? Valid choices are 'true' or 'false' (including quotes). define('ENABLE_SSL_CATALOG', 'false');// NOTE: be sure to leave the trailing '/' at the end of these lines if you make changes!// * DIR_WS_* = Webserver directories (virtual/URL) // these paths are relative to top of your webspace ... (ie: under the public_html or httpdocs folder) $t1 = parse_url(HTTP_SERVER);$p1 = $t1['path'];$t2 = parse_url(HTTPS_SERVER);$p2 = $t2['path']; define('DIR_WS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p1) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/'); define('DIR_WS_CATALOG', '/'); define('DIR_WS_HTTPS_ADMIN', preg_replace('#^' . str_replace('-', '\-', $p2) . '#', '', dirname($_SERVER['SCRIPT_NAME'])) . '/'); define('DIR_WS_HTTPS_CATALOG', '/'); define('DIR_WS_IMAGES', 'images/'); define('DIR_WS_ICONS', DIR_WS_IMAGES . 'icons/'); define('DIR_WS_CATALOG_IMAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'images/'); define('DIR_WS_CATALOG_TEMPLATE', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/templates/'); define('DIR_WS_INCLUDES', 'includes/'); define('DIR_WS_BOXES', DIR_WS_INCLUDES . 'boxes/'); define('DIR_WS_FUNCTIONS', DIR_WS_INCLUDES . 'functions/'); define('DIR_WS_CLASSES', DIR_WS_INCLUDES . 'classes/'); define('DIR_WS_MODULES', DIR_WS_INCLUDES . 'modules/'); define('DIR_WS_LANGUAGES', DIR_WS_INCLUDES . 'languages/'); define('DIR_WS_CATALOG_LANGUAGES', HTTP_CATALOG_SERVER . DIR_WS_CATALOG . 'includes/languages/');// * DIR_FS_* = Filesystem directories (local/physical) define('DIR_FS_ADMIN', realpath(dirname(__FILE__) . '/../') . '/'); //the following path is a COMPLETE path to your Zen Cart files. eg: /var/www/vhost/accountname/public_html/store/ define('DIR_FS_CATALOG', '/home/honor/public_html/'); //the following path is a COMPLETE path to the /logs/ folder eg: /var/www/vhost/accountname/public_html/store/logs ... and no trailing slash define('DIR_FS_LOGS', '/home/honor/public_html/logs'); define('DIR_FS_CATALOG_LANGUAGES', DIR_FS_CATALOG . 'includes/languages/'); define('DIR_FS_CATALOG_IMAGES', DIR_FS_CATALOG . 'images/'); define('DIR_FS_CATALOG_MODULES', DIR_FS_CATALOG . 'includes/modules/'); define('DIR_FS_CATALOG_TEMPLATES', DIR_FS_CATALOG . 'includes/templates/'); define('DIR_FS_BACKUP', DIR_FS_ADMIN . 'backups/'); define('DIR_FS_EMAIL_TEMPLATES', DIR_FS_CATALOG . 'email/'); define('DIR_FS_DOWNLOAD', DIR_FS_CATALOG . 'download/');// define our database connection define('DB_TYPE', 'mysql'); define('DB_PREFIX', 'zen_'); define('DB_CHARSET', 'utf8'); define('DB_SERVER', 'localhost'); define('DB_SERVER_USERNAME', 'honor_zenuser'); define('DB_SERVER_PASSWORD', 'LKjh8108'); define('DB_DATABASE', 'honor_zencart'); // The next 2 "defines" are for SQL cache support. // For SQL_CACHE_METHOD, you can select from: none, database, or file // If you choose "file", then you need to set the DIR_FS_SQL_CACHE to a directory where your apache // or webserver user has write privileges (chmod 666 or 777). We recommend using the "cache" folder inside the Zen Cart folder // ie: /path/to/your/webspace/public_html/zen/cache -- leave no trailing slash define('SQL_CACHE_METHOD', 'none'); define('DIR_FS_SQL_CACHE', '/home/honor/public_html/cache');// Define the webserver and path parameters // Main webserver: eg-http://www.your_domain.com - // HTTP_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_SERVER is your Secure webserver: eg-https://www.your_domain.com // HTTP_CATALOG_SERVER is your Main webserver: eg-http://www.your_domain.com // HTTPS_CATALOG_SERVER is your Secure webserver: eg-https://www.your_domain.com /* * URLs for your site will be built via: * HTTP_SERVER plus DIR_WS_ADMIN or * HTTPS_SERVER plus DIR_WS_HTTPS_ADMIN or * HTTP_SERVER plus DIR_WS_CATALOG or * HTTPS_SERVER plus DIR_WS_HTTPS_CATALOG * ...depending on your system configuration settings */// EOF ```
6 Oct 2015, 2:11 AM
#16
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

ZC 1.5.1, correct?

Have you modified the includes/functions/html_output.php file to change or address the need to assign/cast the SESSIONS constant I think it was? It's a change that is incorporated in more recent ZC versions and causes if I remember correctly memory to be exhasted similar to what is reported here... Though I am a little surprised to see adm error logs that don't include the admin directory path, generally speaking...

6 Oct 2015, 2:15 AM
#17
lidlchris avatar

lidlchris

Zen Follower

Join Date:
Feb 2013
Posts:
345
Plugin Contributions:
0

Re: Can't access admin section after changing DB password

mc12345678:

ZC 1.5.1, correct?

Have you modified the includes/functions/html_output.php file to change or address the need to assign/cast the SESSIONS constant I think it was? It's a change that is incorporated in more recent ZC versions and causes if I remember correctly memory to be exhasted similar to what is reported here... Though I am a little surprised to see adm error logs that don't include the admin directory path, generally speaking...

yes it is 1.5.1 - i think.. i can't get in.. i did NOT modify the includes/functions/html_output.php.. what should i change there?? the memory errors were NOT in the adm log files.

6 Oct 2015, 2:24 AM
#18
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

Umm,unfortunately may need to change the DB password again... All the DB stuff got posted... It's not quite formatted as expected, but it's there...

6 Oct 2015, 2:28 AM
#19
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

lidlchris:

yes it is 1.5.1 - i think.. i can't get in.. i did NOT modify the includes/functions/html_output.php.. what should i change there?? the memory errors were NOT in the adm log files.

I was wrong, it was SID which represents the SessionID.

Find this at or around line 62:

      if (defined('SID') && zen_not_null(SID)) {
        $sid = SID;

And change to:

      if (defined('SID') && zen_not_null(constant('SID'))) {
        $sid = constant('SID');
6 Oct 2015, 2:29 AM
#20
mc12345678 avatar

mc12345678

Totally Zenned

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

Re: Can't access admin section after changing DB password

What php version is installed?