I'm having a strange issue with phpmyadmin 4.0.10. First of all I'm running this version because my mysql version is 5.1.57.
I have phpmyadmin set up and everything configured except for the storage settings. I've created the phpmyadmin db and necessary tables. I also created the pma user and made sure all of its permissions are correct. In my config file I've added the settings for this user and copied over the password.
If I save my config at this point without actually setting up the storage database and tables everything works just fine. However, if I enable these tables I get the following error 500 message in my logs whenever I try to add a column to a table's structure.
PHP Fatal error: Call to undefined function ._Application_Octetstream_Download_getInfo() in /htdocs/phpmyadmin/libraries/transformations.lib.php on line 153
Any idea what's going on here? I've deleted and recreated my phpmyadmin database. I've deleted and recreated the pma user. I've deleted and recreated my config file and that's how I eventually tracked this error down to the storage tables.
If it helps, this is the piece of code causing the issue in the transformations.lib.php file:
/**
* Returns the description of the transformation
*
* @param string $file transformation file
* @param boolean $html_formatted whether the description should be formatted
* as HTML
*
* @return String the description of the transformation
*/
function PMA_getTransformationDescription($file, $html_formatted = true)
{
// get the transformation class name
$class_name = explode(".class.php", $file);
$class_name = $class_name[0];
// include and instantiate the class
include_once 'libraries/plugins/transformations/' . $file;
return $class_name::getInfo();
}
After looking through the code I ended up at this function.
/**
* Gets all available MIME-types
*
* @access public
* @staticvar array mimetypes
* @return array array[mimetype], array[transformation]
*/
function PMA_getAvailableMIMEtypes()
{
static $stack = null;
if (null !== $stack) {
return $stack;
}
$stack = array();
$filestack = array();
$handle = opendir('./libraries/plugins/transformations');
if (! $handle) {
return $stack;
}
while ($file = readdir($handle)) {
$filestack[] = $file;
}
closedir($handle);
sort($filestack);
foreach ($filestack as $file) {
if (preg_match('|^.*_.*_.*\.class\.php$|', $file)) {
// File contains transformation functions.
$parts = explode('_', str_replace('.class.php', '', $file));
$mimetype = $parts[0] . "/" . $parts[1];
$stack['mimetype'][$mimetype] = $mimetype;
$stack['transformation'][] = $mimetype . ': ' . $parts[2];
$stack['transformation_file'][] = $file;
} elseif (preg_match('|^.*\.class.php$|', $file)) {
// File is a plain mimetype, no functions.
$base = str_replace('.class.php', '', $file);
if ($base != 'global') {
$mimetype = str_replace('_', '/', $base);
$stack['mimetype'][$mimetype] = $mimetype;
$stack['empty_mimetype'][$mimetype] = $mimetype;
}
}
}
return $stack;
}
My php skills are limited but I can tell it's reading through the files in the plugins/transformations directory and returning those file names to the scripts that reference this function. When I browsed this directory from a terminal I noticed that it was filled up with ._ files created by finder. I use a mac to do my development on and I had pulled this latest copy of phpmyadmin using finder instead of wget so all of these ._ files were created. Something about them messed up this function and once I removed them with a find command at the base level everything worked as intended. Here's the find command for anyone experiencing something similar:
find . -type f -name '._*' -exec rm {} \;
Again, run that at the base level of the phpmyadmin directory and all should be well.