Koozali.org: home of the SME Server

odd error with garbage in phpMyAdmin configuration file

Offline wdepot

  • ****
  • 101
  • +0/-0
    • http://westerndepot.com
odd error with garbage in phpMyAdmin configuration file
« on: May 10, 2013, 12:17:21 AM »
I've suddenly run into a strange problem with my /etc/phpMyAdmin/config.inc.php file in SME 8. After a recent server update suddenly phpMyAdmin won't start because of an error message due to garbage in the very beginning of the config.inc.php file. I can't figure out where the garbage comes from. I've checked all of the related template files and none of them contains the garbage that is showing up. The stock e-smith templates folder for the file contains template-begin, template-end (both empty) and 10config which I've checked and confirmed is free of garbage. The templates-custom folder for the file contains only 20user-config which contains the information I had to add for phpMyAdmin to use the database configuration settings that was new to version 3 and again this file is free of garbage.

When the template for the config.inc.php is being expanded (either with expand-template or by server reconfigure) somehow the garbage is being added to the file essentially between template-begin and 10config. Does anyone have any ideas why this could be happening or, more importantly, how to prevent it? Sure I can edit the garbage out of the config file after every server update so I can run phpMyAdmin but I would sure prefer to prevent the problem in the first place.

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #1 on: May 11, 2013, 11:37:00 AM »
what about sharing the config file here?

Offline piran

  • *****
  • 502
  • +0/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #2 on: May 11, 2013, 02:38:01 PM »
I can't figure out where the garbage comes from.

Ditto what Stefano says but also what editing
mechanism are you using to generate/edit your file?

PostEdit: -ph +f

Offline wdepot

  • ****
  • 101
  • +0/-0
    • http://westerndepot.com
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #3 on: May 11, 2013, 11:39:16 PM »
I originally used TextEdit (Mac OSX 10.4) in text mode to create the 20user-config templates-custom file and then tried Microsoft Word saving in Western ASCII to see if that made any difference. The file in the templates folder are what were installed by smeserver-phpmyadmin. The expanded file ends up looking like this:
Code: [Select]
???Bud1????????????%???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????@??????€????????????????????????????????? ??????@??????€??????????????????????????????????? ??????@??????€??????????????????????????????????? ??????@???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ???E???%???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????DSDB?????????????????????????????`??????????€???????????????????????????????????? ??????@??????€??????????????????????????????????? ??????@??????€??????????????????????????????????? ??????@??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 2.9.0.2 setup script by Michal ÄŒihař <michal@cihar.com>
 * Version: $Id: setup.php,v 1.36.2.3.2.1 2006/10/03 13:11:08 nijel Exp $
 * Date: Thu, 12 Oct 2006 16:17:17 GMT
 */

/* Servers configuration */
$i 0;

/* Server localhost (config:root) [1] */
$i++;
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['extension'] = 'mysql';
$cfg['Servers'][$i]['connect_type'] = 'tcp';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password']        = 'edited out';
/* End of servers configuration */

?>

<?php

/* User used to manipulate with storage */
$cfg['Servers'][$i]['controlhost'] = 'localhost';
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'edited out';
/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
$cfg['Servers'][$i]['relation'] = 'pma_relation';
$cfg['Servers'][$i]['table_info'] = 'pma_table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma_column_info';
$cfg['Servers'][$i]['history'] = 'pma_history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma_tracking';
$cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
$cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
$cfg['Servers'][$i]['recent'] = 'pma_recent';
$cfg['ShowPhpInfo'] = true;
$cfg['ShowServerInfo'] = true;
$cfg['ShowStats'] = true;

?>



Since the garbage all appears at the very beginning of the file I would think it would come either from the template-begin file, but that it totally empty, or the 10config file, but when I check that file it contains nothing but the code that generates the section between and including the first <?php and ?> pair.

Offline wdepot

  • ****
  • 101
  • +0/-0
    • http://westerndepot.com
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #4 on: May 12, 2013, 12:10:20 AM »
I did just figure out a way to isolate the garbage so it won't cause problems. In the templates-custom folder for this file I created a template-begin file containing:
Code: [Select]
<?php /*
and an 01a file containing:
Code: [Select]
*/ ?>
When I expand the template now the garbage is still in the config file but now it appears as a strange looking PHP comment as it now gets inserted between the begin and end comment code.

I would still like to know if anyone has any ideas where the garbage is coming from. As far as I know the expanded config.inc.php file is the only templated file to get garbage inserted into it but with the occasional sudden unexplained slowdowns our web server has been experiencing lately I wonder if something else could be ending up with some garbage in it.

Offline piran

  • *****
  • 502
  • +0/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #5 on: May 12, 2013, 12:34:11 AM »
Try editing your (template) file on the server using:
nano -w YourFile
...save it out using CtrlX. Less chance of any
'garbage' getting inserted by other OS editors.

Offline wdepot

  • ****
  • 101
  • +0/-0
    • http://westerndepot.com
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #6 on: May 12, 2013, 02:08:53 AM »
Okay, BUT, the garbage was being inserted at the beginning of a file I hadn't edited. The 10config template file came directly from the smeserver-phpmyadmin install and was originally creating a perfectly fine config.inc.php file. The fact that the garbage is now contained between my new templates-custom/template-begin file and the 01a file would almost indicate to me that there is some other file located in one of the two templates folders for the config.inc.php file that is being added to the template right after template-begin. The only thing is, I've logged directly into the server as root and done an ls -a on both the templates and the templates-custom and no other files show up. As for as I know there isn't a way to hide files so the root user can't see them, is there?

Offline piran

  • *****
  • 502
  • +0/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #7 on: May 12, 2013, 04:08:19 AM »
>>Sure I can edit the garbage out of the config file after every server update so I can run phpMyAdmin
EVERY server update?
After a simple reboot?
I'm not convinced that you aren't
'introducing' this 'garbage' yourself.
But YMMV. I'm not a dreadfully heavy
user of phpmyadmin myself but perhaps
it might be prudent to change passwords
and avoid unnecessary use of the root user.

Offline holck

  • *
  • 322
  • +1/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #8 on: May 12, 2013, 09:17:39 AM »
One explanation of the garbage might be some corruption in the e-smith files used for expanding templates. You can easily check this:
Code: [Select]
rpm -V e-smith-libThis will display any changes in the files from the rpm-package.
......

Offline holck

  • *
  • 322
  • +1/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #9 on: May 12, 2013, 09:27:29 AM »
Another explanation might be a hidden file in one of the template directories. The standard behavior of the 'ls' command is to hide files, if their names have an initial dot, "."

So you should use 'ls -a' to look for all files in the template directories.

Jesper / Denmark
......

Offline Stefano

  • *
  • 10,894
  • +3/-0
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #10 on: May 12, 2013, 11:13:29 AM »
wdepot

don't use external editors..
edit/create your fragments using nano

Offline wdepot

  • ****
  • 101
  • +0/-0
    • http://westerndepot.com
Re: odd error with garbage in phpMyAdmin configuration file
« Reply #11 on: May 14, 2013, 10:29:12 PM »
The problem is now solved thanks to the person who suggested ls -a and it had nothing to do with a text editor.

I thought I had done ls -a on both template folders but apparently I had only done it on the stock template folder and not the phpMyAdmin templates-custom folder. It turns out that when I had uploaded the custom 20user-config file I had done so by simply dragging the phpMyAdmin folder and it's contents into the templates-custom folder using Fugu on my Power Mac. Doing that also copied the .DS_Store file that the Mac automatically creates in every folder to the server and it was that file that was causing the garbage to be included whenever the template was expanded, either manually or after a server update with its associated reconfigure restart which expands all templates.

Lesson learned: create template-custom folders directly on the server and then copy only the content files to avoid hidden files like .DS_Store being uploaded.