{"id":1054,"date":"2010-11-06T20:49:25","date_gmt":"2010-11-06T18:49:25","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=1054"},"modified":"2011-05-01T12:18:02","modified_gmt":"2011-05-01T09:18:02","slug":"upgrading-plesks-phpmyadmin-to-the-latest-version","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2010\/11\/06\/upgrading-plesks-phpmyadmin-to-the-latest-version\/","title":{"rendered":"Upgrading Plesk&#8217;s phpMyAdmin to the latest version"},"content":{"rendered":"<p><a href=\"http:\/\/www.phpmyadmin.net\/\">phpMyAdmin<\/a> is a great tool but a constant <a href=\"http:\/\/www.phpmyadmin.net\/home_page\/security\/\">headache<\/a> (xss, sql injections,etc) as well. Every now and then there are new security holes discovered that need to be fixed ASAP. On the other hand, <a href=\"http:\/\/www.parallels.com\/plesk\/\">Plesk<\/a> doesn&#8217;t seem to follow these security fixes, so if you want to keep yourself a bit more secure than Plesk thinks you should be, then you have to upgrade phpMyAdmin by your self. This procedure isn&#8217;t very straightforward due to the way Plesk uses PMA so I&#8217;ll post here some notes\/guidelines on how to achieve that.<\/p>\n<p>My notes are based on Plesk 8.6, so I am sure newer Plesk versions are way easier to upgrade than this.<\/p>\n<p><strong>Step 1: Download new phpMyAdmin <\/strong><br \/>\n<code># wget http:\/\/downloads.sourceforge.net\/project\/phpmyadmin\/phpMyAdmin\/3.3.8\/phpMyAdmin-3.3.8-all-languages.tar.gz<\/code><br \/>\n<strong>Step 2: Extract into \/opt\/psa\/admin\/htdocs\/domains\/databases\/<\/strong><br \/>\n<pre><code2># mv phpMyAdmin-3.3.8-all-languages.tar.gz \/opt\/psa\/admin\/htdocs\/domains\/databases\/\n# cd \/opt\/psa\/admin\/htdocs\/domains\/databases\/\n# tar zxf phpMyAdmin-3.3.8-all-languages.tar.gz<\/code2><\/pre><br \/>\n<strong>Step 3: Rename old PMA and symlink the new<\/strong><br \/>\n<pre><code2># mv phpMyAdmin phpMyAdmin.old\n# ln -sf phpMyAdmin-3.3.8-all-languages phpMyAdmin<\/code2><\/pre><br \/>\n<strong>Step 4: Copy old config file<\/strong><br \/>\nThis step depends on your old PMA version. Since my version was 2.8.2.4 I had to:<br \/>\n<code>#cp phpMyAdmin.old\/libraries\/config.default.php phpMyAdmin\/config.inc.php<\/code><br \/>\nIf you have newer versions of PMA just do:<br \/>\n<code>#cp phpMyAdmin.old\/config.inc.php phpMyAdmin\/config.inc.php<\/code><br \/>\n<strong>Step 5: Edit necessary files<\/strong><br \/>\n<strong>Substep a: edit phpMyAdmin\/libraries\/session.inc.php<\/strong><br \/>\nWhen the first comment block finishes and <em>before<\/em> line 14: <code>if (! defined('PHPMYADMIN')) {<\/code><br \/>\nadd the following snippet:<br \/>\n<pre><code2>\/\/ Close Plesk&#039;s session.\n$proxy_session_id = session_id();\n@session_write_close();\nunset($_SESSION);<\/code2><\/pre><br \/>\n<strong>Substep b: edit phpMyAdmin\/libraries\/common.inc.php around line 190 and change:<\/strong><br \/>\n<pre><code2>&nbsp;&nbsp;&nbsp;&nbsp;&#039;error_handler&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;PMA_PHP_SELF&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;variables_whitelist&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;key&#039;\n);<\/code2><\/pre><br \/>\nto<br \/>\n<pre><code2>&#039;error_handler&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;PMA_PHP_SELF&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;variables_whitelist&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;key&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;\/\/ from Plesk\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;PHP_SELF&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;db_host&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;db_port&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;db_user&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;db_pass&#039;,\n&nbsp;&nbsp;&nbsp;&nbsp;&#039;db_name&#039;\n);<\/code2><\/pre><\/p>\n<p>!! Mind the &#8220;,&#8221; after <em>&#8216;key&#8217;<\/em> !!<\/p>\n<p>That&#8217;s about it&#8230;you should now be able to use your new PMA version through Plesk.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>phpMyAdmin is a great tool but a constant headache (xss, sql injections,etc) as well. Every now and then there are new security holes discovered that need to be fixed ASAP. On the other hand, Plesk doesn&#8217;t seem to follow these security fixes, so if you want to keep yourself a bit more secure than Plesk [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[5,3,8],"tags":[320,33,317,209,318,206,299,319,321],"class_list":["post-1054","post","type-post","status-publish","format-standard","hentry","category-internet","category-linux","category-networking","tag-config","tag-debian","tag-phpmyadmin","tag-plesk","tag-pma","tag-security","tag-sql-injection","tag-vhost","tag-xss"],"aioseo_notices":[],"views":17177,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1054","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=1054"}],"version-history":[{"count":13,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1054\/revisions"}],"predecessor-version":[{"id":1117,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/1054\/revisions\/1117"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=1054"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=1054"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=1054"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}