setup.html 119 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Installation &#8212; phpMyAdmin 4.8.5 documentation</title>
  7. <link rel="stylesheet" href="_static/classic.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: './',
  12. VERSION: '4.8.5',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="index" title="Index" href="genindex.html" />
  22. <link rel="search" title="Search" href="search.html" />
  23. <link rel="copyright" title="Copyright" href="copyright.html" />
  24. <link rel="top" title="phpMyAdmin 4.8.5 documentation" href="index.html" />
  25. <link rel="next" title="Configuration" href="config.html" />
  26. <link rel="prev" title="Requirements" href="require.html" />
  27. </head>
  28. <body role="document">
  29. <div class="related" role="navigation" aria-label="related navigation">
  30. <h3>Navigation</h3>
  31. <ul>
  32. <li class="right" style="margin-right: 10px">
  33. <a href="genindex.html" title="General Index"
  34. accesskey="I">index</a></li>
  35. <li class="right" >
  36. <a href="config.html" title="Configuration"
  37. accesskey="N">next</a> |</li>
  38. <li class="right" >
  39. <a href="require.html" title="Requirements"
  40. accesskey="P">previous</a> |</li>
  41. <li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.5 documentation</a> &#187;</li>
  42. </ul>
  43. </div>
  44. <div class="document">
  45. <div class="documentwrapper">
  46. <div class="bodywrapper">
  47. <div class="body" role="main">
  48. <div class="section" id="installation">
  49. <span id="setup"></span><h1>Installation<a class="headerlink" href="#installation" title="Permalink to this headline">¶</a></h1>
  50. <p>phpMyAdmin does not apply any special security methods to the MySQL
  51. database server. It is still the system administrator&#8217;s job to grant
  52. permissions on the MySQL databases properly. phpMyAdmin&#8217;s <span class="guilabel">Users</span>
  53. page can be used for this.</p>
  54. <div class="admonition warning">
  55. <p class="first admonition-title">Warning</p>
  56. <p class="last"><a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a> users should note that if you are on a version before
  57. <a class="reference internal" href="glossary.html#term-mac-os-x"><span class="xref std std-term">Mac OS X</span></a>, StuffIt unstuffs with <a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a> formats. So you&#8217;ll have
  58. to resave as in BBEdit to Unix style ALL phpMyAdmin scripts before
  59. uploading them to your server, as PHP seems not to like <a class="reference internal" href="glossary.html#term-mac"><span class="xref std std-term">Mac</span></a>-style
  60. end of lines character (&#8220;<code class="docutils literal"><span class="pre">\r</span></code>&#8221;).</p>
  61. </div>
  62. <div class="section" id="linux-distributions">
  63. <h2>Linux distributions<a class="headerlink" href="#linux-distributions" title="Permalink to this headline">¶</a></h2>
  64. <p>phpMyAdmin is included in most Linux distributions. It is recommended to use
  65. distribution packages when possible - they usually provide integration to your
  66. distribution and you will automatically get security updates from your distribution.</p>
  67. <div class="section" id="debian">
  68. <span id="debian-package"></span><h3>Debian<a class="headerlink" href="#debian" title="Permalink to this headline">¶</a></h3>
  69. <p>Debian&#8217;s package repositories include a phpMyAdmin package, but be aware that
  70. the configuration file is maintained in <code class="docutils literal"><span class="pre">/etc/phpmyadmin</span></code> and may differ in
  71. some ways from the official phpMyAdmin documentation. Specifically it does:</p>
  72. <ul class="simple">
  73. <li>Configuration of web server (works for Apache and lighttpd).</li>
  74. <li>Creating of <a class="reference internal" href="#linked-tables"><span class="std std-ref">phpMyAdmin configuration storage</span></a> using dbconfig-common.</li>
  75. <li>Securing setup script, see <a class="reference internal" href="#debian-setup"><span class="std std-ref">Setup script on Debian, Ubuntu and derivatives</span></a>.</li>
  76. </ul>
  77. <div class="admonition seealso">
  78. <p class="first admonition-title">See also</p>
  79. <p class="last">More information can be found in <a class="reference external" href="https://salsa.debian.org/phpmyadmin-team/phpmyadmin/blob/master/debian/README.Debian">README.Debian</a>
  80. (it is installed as <code class="file docutils literal"><span class="pre">/usr/share/doc/phmyadmin/README.Debian</span></code> with the package).</p>
  81. </div>
  82. </div>
  83. <div class="section" id="opensuse">
  84. <h3>OpenSUSE<a class="headerlink" href="#opensuse" title="Permalink to this headline">¶</a></h3>
  85. <p>OpenSUSE already comes with phpMyAdmin package, just install packages from
  86. the <a class="reference external" href="https://software.opensuse.org/package/phpMyAdmin">openSUSE Build Service</a>.</p>
  87. </div>
  88. <div class="section" id="ubuntu">
  89. <h3>Ubuntu<a class="headerlink" href="#ubuntu" title="Permalink to this headline">¶</a></h3>
  90. <p>Ubuntu ships phpMyAdmin package, however if you want to use recent version, you
  91. can use packages from
  92. <a class="reference external" href="https://launchpad.net/~nijel/+archive/ubuntu/phpmyadmin">phpMyAdmin PPA</a>.</p>
  93. <div class="admonition seealso">
  94. <p class="first admonition-title">See also</p>
  95. <p class="last">The packages are same as in <a class="reference internal" href="#debian-package"><span class="std std-ref">Debian</span></a> please check the documentation
  96. there for more details.</p>
  97. </div>
  98. </div>
  99. <div class="section" id="gentoo">
  100. <h3>Gentoo<a class="headerlink" href="#gentoo" title="Permalink to this headline">¶</a></h3>
  101. <p>Gentoo ships the phpMyAdmin package, both in a near stock configuration as well
  102. as in a <code class="docutils literal"><span class="pre">webapp-config</span></code> configuration. Use <code class="docutils literal"><span class="pre">emerge</span> <span class="pre">dev-db/phpmyadmin</span></code> to
  103. install.</p>
  104. </div>
  105. <div class="section" id="mandriva">
  106. <h3>Mandriva<a class="headerlink" href="#mandriva" title="Permalink to this headline">¶</a></h3>
  107. <p>Mandriva ships the phpMyAdmin package in their <code class="docutils literal"><span class="pre">contrib</span></code> branch and can be
  108. installed via the usual Control Center.</p>
  109. </div>
  110. <div class="section" id="fedora">
  111. <h3>Fedora<a class="headerlink" href="#fedora" title="Permalink to this headline">¶</a></h3>
  112. <p>Fedora ships the phpMyAdmin package, but be aware that the configuration file
  113. is maintained in <code class="docutils literal"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the
  114. official phpMyAdmin documentation.</p>
  115. </div>
  116. <div class="section" id="red-hat-enterprise-linux">
  117. <h3>Red Hat Enterprise Linux<a class="headerlink" href="#red-hat-enterprise-linux" title="Permalink to this headline">¶</a></h3>
  118. <p>Red Hat Enterprise Linux itself and thus derivatives like CentOS don&#8217;t
  119. ship phpMyAdmin, but the Fedora-driven repository
  120. <a class="reference external" href="https://fedoraproject.org/wiki/EPEL">Extra Packages for Enterprise Linux (EPEL)</a>
  121. is doing so, if it&#8217;s
  122. <a class="reference external" href="https://fedoraproject.org/wiki/EPEL/FAQ#howtouse">enabled</a>.
  123. But be aware that the configuration file is maintained in
  124. <code class="docutils literal"><span class="pre">/etc/phpMyAdmin/</span></code> and may differ in some ways from the
  125. official phpMyAdmin documentation.</p>
  126. </div>
  127. </div>
  128. <div class="section" id="installing-on-windows">
  129. <h2>Installing on Windows<a class="headerlink" href="#installing-on-windows" title="Permalink to this headline">¶</a></h2>
  130. <p>The easiest way to get phpMyAdmin on Windows is using third party products
  131. which include phpMyAdmin together with a database and web server such as
  132. <a class="reference external" href="https://www.apachefriends.org/index.html">XAMPP</a>.</p>
  133. <p>You can find more of such options at <a class="reference external" href="https://en.wikipedia.org/wiki/List_of_AMP_packages">Wikipedia</a>.</p>
  134. </div>
  135. <div class="section" id="installing-from-git">
  136. <h2>Installing from Git<a class="headerlink" href="#installing-from-git" title="Permalink to this headline">¶</a></h2>
  137. <p>You can clone current phpMyAdmin source from
  138. <code class="docutils literal"><span class="pre">https://github.com/phpmyadmin/phpmyadmin.git</span></code>:</p>
  139. <div class="highlight-sh"><div class="highlight"><pre><span></span>git clone https://github.com/phpmyadmin/phpmyadmin.git
  140. </pre></div>
  141. </div>
  142. <p>Additionally you need to install dependencies using the <a class="reference external" href="https://getcomposer.org/">Composer tool</a>:</p>
  143. <div class="highlight-sh"><div class="highlight"><pre><span></span>composer update
  144. </pre></div>
  145. </div>
  146. <p>If you do not intend to develop, you can skip the installation of developer tools
  147. by invoking:</p>
  148. <div class="highlight-sh"><div class="highlight"><pre><span></span>composer update --no-dev
  149. </pre></div>
  150. </div>
  151. </div>
  152. <div class="section" id="installing-using-composer">
  153. <span id="composer"></span><h2>Installing using Composer<a class="headerlink" href="#installing-using-composer" title="Permalink to this headline">¶</a></h2>
  154. <p>You can install phpMyAdmin using the <a class="reference external" href="https://getcomposer.org/">Composer tool</a>, since 4.7.0 the releases
  155. are automatically mirrored to the default <a class="reference external" href="https://packagist.org/">Packagist</a> repository.</p>
  156. <div class="admonition note">
  157. <p class="first admonition-title">Note</p>
  158. <p class="last">The content of the Composer repository is automatically generated
  159. separately from the releases, so the content doesn&#8217;t have to be
  160. 100% same as when you download the tarball. There should be no
  161. functional differences though.</p>
  162. </div>
  163. <p>To install phpMyAdmin simply run:</p>
  164. <div class="highlight-sh"><div class="highlight"><pre><span></span>composer create-project phpmyadmin/phpmyadmin
  165. </pre></div>
  166. </div>
  167. <p>Alternatively you can use our own composer repository, which contains
  168. the release tarballs and is available at
  169. &lt;<a class="reference external" href="https://www.phpmyadmin.net/packages.json">https://www.phpmyadmin.net/packages.json</a>&gt;:</p>
  170. <div class="highlight-sh"><div class="highlight"><pre><span></span>composer create-project phpmyadmin/phpmyadmin --repository-url<span class="o">=</span>https://www.phpmyadmin.net/packages.json --no-dev
  171. </pre></div>
  172. </div>
  173. </div>
  174. <div class="section" id="installing-using-docker">
  175. <span id="docker"></span><h2>Installing using Docker<a class="headerlink" href="#installing-using-docker" title="Permalink to this headline">¶</a></h2>
  176. <p>phpMyAdmin comes with a <a class="reference external" href="https://hub.docker.com/r/phpmyadmin/phpmyadmin/">Docker image</a>, which you can easily deploy. You can
  177. download it using:</p>
  178. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker pull phpmyadmin/phpmyadmin
  179. </pre></div>
  180. </div>
  181. <p>The phpMyAdmin server will listen on port 80. It supports several ways of
  182. configuring the link to the database server, either by Docker&#8217;s link feature
  183. by linking your database container to <code class="docutils literal"><span class="pre">db</span></code> for phpMyAdmin (by specifying
  184. <code class="docutils literal"><span class="pre">--link</span> <span class="pre">your_db_host:db</span></code>) or by environment variables (in this case it&#8217;s up
  185. to you to set up networking in Docker to allow the phpMyAdmin container to access
  186. the database container over network).</p>
  187. <div class="section" id="docker-environment-variables">
  188. <span id="docker-vars"></span><h3>Docker environment variables<a class="headerlink" href="#docker-environment-variables" title="Permalink to this headline">¶</a></h3>
  189. <p>You can configure several phpMyAdmin features using environment variables:</p>
  190. <dl class="envvar">
  191. <dt id="envvar-PMA_ARBITRARY">
  192. <code class="descname">PMA_ARBITRARY</code><a class="headerlink" href="#envvar-PMA_ARBITRARY" title="Permalink to this definition">¶</a></dt>
  193. <dd><p>Allows you to enter a database server hostname on login form.</p>
  194. <div class="admonition seealso">
  195. <p class="first admonition-title">See also</p>
  196. <p class="last"><span class="target" id="index-0"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><code class="xref config config-option docutils literal"><span class="pre">$cfg['AllowArbitraryServer']</span></code></a></p>
  197. </div>
  198. </dd></dl>
  199. <dl class="envvar">
  200. <dt id="envvar-PMA_HOST">
  201. <code class="descname">PMA_HOST</code><a class="headerlink" href="#envvar-PMA_HOST" title="Permalink to this definition">¶</a></dt>
  202. <dd><p>Host name or IP address of the database server to use.</p>
  203. <div class="admonition seealso">
  204. <p class="first admonition-title">See also</p>
  205. <p class="last"><span class="target" id="index-1"></span><a class="reference internal" href="config.html#cfg_Servers_host"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['host']</span></code></a></p>
  206. </div>
  207. </dd></dl>
  208. <dl class="envvar">
  209. <dt id="envvar-PMA_HOSTS">
  210. <code class="descname">PMA_HOSTS</code><a class="headerlink" href="#envvar-PMA_HOSTS" title="Permalink to this definition">¶</a></dt>
  211. <dd><p>Comma-separated host names or IP addresses of the database servers to use.</p>
  212. <div class="admonition note">
  213. <p class="first admonition-title">Note</p>
  214. <p class="last">Used only if <span class="target" id="index-2"></span><a class="reference internal" href="#envvar-PMA_HOST"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_HOST</span></code></a> is empty.</p>
  215. </div>
  216. </dd></dl>
  217. <dl class="envvar">
  218. <dt id="envvar-PMA_VERBOSE">
  219. <code class="descname">PMA_VERBOSE</code><a class="headerlink" href="#envvar-PMA_VERBOSE" title="Permalink to this definition">¶</a></dt>
  220. <dd><p>Verbose name of the database server.</p>
  221. <div class="admonition seealso">
  222. <p class="first admonition-title">See also</p>
  223. <p class="last"><span class="target" id="index-3"></span><a class="reference internal" href="config.html#cfg_Servers_verbose"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['verbose']</span></code></a></p>
  224. </div>
  225. </dd></dl>
  226. <dl class="envvar">
  227. <dt id="envvar-PMA_VERBOSES">
  228. <code class="descname">PMA_VERBOSES</code><a class="headerlink" href="#envvar-PMA_VERBOSES" title="Permalink to this definition">¶</a></dt>
  229. <dd><p>Comma-separated verbose name of the database servers.</p>
  230. <div class="admonition note">
  231. <p class="first admonition-title">Note</p>
  232. <p class="last">Used only if <span class="target" id="index-4"></span><a class="reference internal" href="#envvar-PMA_VERBOSE"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_VERBOSE</span></code></a> is empty.</p>
  233. </div>
  234. </dd></dl>
  235. <dl class="envvar">
  236. <dt id="envvar-PMA_USER">
  237. <code class="descname">PMA_USER</code><a class="headerlink" href="#envvar-PMA_USER" title="Permalink to this definition">¶</a></dt>
  238. <dd><p>User name to use for <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  239. </dd></dl>
  240. <dl class="envvar">
  241. <dt id="envvar-PMA_PASSWORD">
  242. <code class="descname">PMA_PASSWORD</code><a class="headerlink" href="#envvar-PMA_PASSWORD" title="Permalink to this definition">¶</a></dt>
  243. <dd><p>Password to use for <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  244. </dd></dl>
  245. <dl class="envvar">
  246. <dt id="envvar-PMA_PORT">
  247. <code class="descname">PMA_PORT</code><a class="headerlink" href="#envvar-PMA_PORT" title="Permalink to this definition">¶</a></dt>
  248. <dd><p>Port of the database server to use.</p>
  249. </dd></dl>
  250. <dl class="envvar">
  251. <dt id="envvar-PMA_PORTS">
  252. <code class="descname">PMA_PORTS</code><a class="headerlink" href="#envvar-PMA_PORTS" title="Permalink to this definition">¶</a></dt>
  253. <dd><p>Comma-separated ports of the database server to use.</p>
  254. <div class="admonition note">
  255. <p class="first admonition-title">Note</p>
  256. <p class="last">Used only if <span class="target" id="index-5"></span><a class="reference internal" href="#envvar-PMA_PORT"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_PORT</span></code></a> is empty.</p>
  257. </div>
  258. </dd></dl>
  259. <dl class="envvar">
  260. <dt id="envvar-PMA_ABSOLUTE_URI">
  261. <code class="descname">PMA_ABSOLUTE_URI</code><a class="headerlink" href="#envvar-PMA_ABSOLUTE_URI" title="Permalink to this definition">¶</a></dt>
  262. <dd><p>The fully-qualified path (<code class="docutils literal"><span class="pre">https://pma.example.net/</span></code>) where the reverse
  263. proxy makes phpMyAdmin available.</p>
  264. <div class="admonition seealso">
  265. <p class="first admonition-title">See also</p>
  266. <p class="last"><span class="target" id="index-6"></span><a class="reference internal" href="config.html#cfg_PmaAbsoluteUri"><code class="xref config config-option docutils literal"><span class="pre">$cfg['PmaAbsoluteUri']</span></code></a></p>
  267. </div>
  268. </dd></dl>
  269. <p>By default, <a class="reference internal" href="#cookie"><span class="std std-ref">Cookie authentication mode</span></a> is used, but if <span class="target" id="index-7"></span><a class="reference internal" href="#envvar-PMA_USER"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_USER</span></code></a> and
  270. <span class="target" id="index-8"></span><a class="reference internal" href="#envvar-PMA_PASSWORD"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_PASSWORD</span></code></a> are set, it is switched to <a class="reference internal" href="#auth-config"><span class="std std-ref">Config authentication mode</span></a>.</p>
  271. <div class="admonition note">
  272. <p class="first admonition-title">Note</p>
  273. <p class="last">The credentials you need to log in are stored in the MySQL server, in case
  274. of Docker image there are various ways to set it (for example
  275. <code class="samp docutils literal"><span class="pre">MYSQL_ROOT_PASSWORD</span></code> when starting the MySQL container). Please check
  276. documentation for <a class="reference external" href="https://hub.docker.com/r/_/mariadb/">MariaDB container</a>
  277. or <a class="reference external" href="https://hub.docker.com/r/_/mysql/">MySQL container</a>.</p>
  278. </div>
  279. </div>
  280. <div class="section" id="customizing-configuration">
  281. <span id="docker-custom"></span><h3>Customizing configuration<a class="headerlink" href="#customizing-configuration" title="Permalink to this headline">¶</a></h3>
  282. <p>Additionally configuration can be tweaked by <code class="file docutils literal"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code>. If
  283. this file exists, it will be loaded after configuration is generated from above
  284. environment variables, so you can override any configuration variable. This
  285. configuration can be added as a volume when invoking docker using
  286. <cite>-v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</cite> parameters.</p>
  287. <p>Note that the supplied configuration file is applied after <a class="reference internal" href="#docker-vars"><span class="std std-ref">Docker environment variables</span></a>,
  288. but you can override any of the values.</p>
  289. <p>For example to change default behaviour of CSV export you can use following
  290. configuration file:</p>
  291. <div class="highlight-php"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  292. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Export&#39;</span><span class="p">][</span><span class="s1">&#39;csv_columns&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">true</span><span class="p">;</span>
  293. <span class="cp">?&gt;</span><span class="x"></span>
  294. </pre></div>
  295. </div>
  296. <p>You can also use it to define server configuration instead of using the
  297. environment variables listed in <a class="reference internal" href="#docker-vars"><span class="std std-ref">Docker environment variables</span></a>:</p>
  298. <div class="highlight-php"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  299. <span class="cm">/* Override Servers array */</span>
  300. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span>
  301. <span class="mi">1</span> <span class="o">=&gt;</span> <span class="p">[</span>
  302. <span class="s1">&#39;auth_type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;cookie&#39;</span><span class="p">,</span>
  303. <span class="s1">&#39;host&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;mydb1&#39;</span><span class="p">,</span>
  304. <span class="s1">&#39;port&#39;</span> <span class="o">=&gt;</span> <span class="mi">3306</span><span class="p">,</span>
  305. <span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Verbose name 1&#39;</span><span class="p">,</span>
  306. <span class="p">],</span>
  307. <span class="mi">2</span> <span class="o">=&gt;</span> <span class="p">[</span>
  308. <span class="s1">&#39;auth_type&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;cookie&#39;</span><span class="p">,</span>
  309. <span class="s1">&#39;host&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;mydb2&#39;</span><span class="p">,</span>
  310. <span class="s1">&#39;port&#39;</span> <span class="o">=&gt;</span> <span class="mi">3306</span><span class="p">,</span>
  311. <span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Verbose name 2&#39;</span><span class="p">,</span>
  312. <span class="p">],</span>
  313. <span class="p">];</span>
  314. </pre></div>
  315. </div>
  316. <div class="admonition seealso">
  317. <p class="first admonition-title">See also</p>
  318. <p class="last">See <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> for detailed description of configuration options.</p>
  319. </div>
  320. </div>
  321. <div class="section" id="docker-volumes">
  322. <h3>Docker Volumes<a class="headerlink" href="#docker-volumes" title="Permalink to this headline">¶</a></h3>
  323. <p>You can use following volumes to customize image behavior:</p>
  324. <p><code class="file docutils literal"><span class="pre">/etc/phpmyadmin/config.user.inc.php</span></code></p>
  325. <blockquote>
  326. <div>Can be used for additional settings, see previous chapter for more details.</div></blockquote>
  327. <p><code class="file docutils literal"><span class="pre">/sessions/</span></code></p>
  328. <blockquote>
  329. <div>Directory where PHP sessions are stored. You might want to share this
  330. for example when using <a class="reference internal" href="#auth-signon"><span class="std std-ref">Signon authentication mode</span></a>.</div></blockquote>
  331. <p><code class="file docutils literal"><span class="pre">/www/themes/</span></code></p>
  332. <blockquote>
  333. <div>Directory where phpMyAdmin looks for themes. By default only those shipped
  334. with phpMyAdmin are included, but you can include additional phpMyAdmin
  335. themes (see <a class="reference internal" href="themes.html#themes"><span class="std std-ref">Custom Themes</span></a>) by using Docker volumes.</div></blockquote>
  336. </div>
  337. <div class="section" id="docker-examples">
  338. <h3>Docker Examples<a class="headerlink" href="#docker-examples" title="Permalink to this headline">¶</a></h3>
  339. <p>To connect phpMyAdmin to a given server use:</p>
  340. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d -e <span class="nv">PMA_HOST</span><span class="o">=</span>dbhost -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin
  341. </pre></div>
  342. </div>
  343. <p>To connect phpMyAdmin to more servers use:</p>
  344. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d -e <span class="nv">PMA_HOSTS</span><span class="o">=</span>dbhost1,dbhost2,dbhost3 -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin
  345. </pre></div>
  346. </div>
  347. <p>To use arbitrary server option:</p>
  348. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name myadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -e <span class="nv">PMA_ARBITRARY</span><span class="o">=</span><span class="m">1</span> phpmyadmin/phpmyadmin
  349. </pre></div>
  350. </div>
  351. <p>You can also link the database container using Docker:</p>
  352. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 phpmyadmin/phpmyadmin
  353. </pre></div>
  354. </div>
  355. <p>Running with additional configuration:</p>
  356. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -v /some/local/directory/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php phpmyadmin/phpmyadmin
  357. </pre></div>
  358. </div>
  359. <p>Running with additional themes:</p>
  360. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker run --name phpmyadmin -d --link mysql_db_server:db -p <span class="m">8080</span>:80 -v /custom/phpmyadmin/theme/:/www/themes/theme/ phpmyadmin/phpmyadmin
  361. </pre></div>
  362. </div>
  363. </div>
  364. <div class="section" id="using-docker-compose">
  365. <h3>Using docker-compose<a class="headerlink" href="#using-docker-compose" title="Permalink to this headline">¶</a></h3>
  366. <p>Alternatively you can also use docker-compose with the docker-compose.yml from
  367. &lt;<a class="reference external" href="https://github.com/phpmyadmin/docker">https://github.com/phpmyadmin/docker</a>&gt;. This will run phpMyAdmin with an
  368. arbitrary server - allowing you to specify MySQL/MariaDB server on login page.</p>
  369. <div class="highlight-sh"><div class="highlight"><pre><span></span>docker-compose up -d
  370. </pre></div>
  371. </div>
  372. </div>
  373. <div class="section" id="customizing-configuration-file-using-docker-compose">
  374. <h3>Customizing configuration file using docker-compose<a class="headerlink" href="#customizing-configuration-file-using-docker-compose" title="Permalink to this headline">¶</a></h3>
  375. <p>You can use an external file to customize phpMyAdmin configuration and pass it
  376. using the volumes directive:</p>
  377. <div class="highlight-yaml"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span><span class="p p-Indicator">:</span>
  378. <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin/phpmyadmin</span>
  379. <span class="l l-Scalar l-Scalar-Plain">container_name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  380. <span class="l l-Scalar l-Scalar-Plain">environment</span><span class="p p-Indicator">:</span>
  381. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_ARBITRARY=1</span>
  382. <span class="l l-Scalar l-Scalar-Plain">restart</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
  383. <span class="l l-Scalar l-Scalar-Plain">ports</span><span class="p p-Indicator">:</span>
  384. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">8080:80</span>
  385. <span class="l l-Scalar l-Scalar-Plain">volumes</span><span class="p p-Indicator">:</span>
  386. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/sessions</span>
  387. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">~/docker/phpmyadmin/config.user.inc.php:/etc/phpmyadmin/config.user.inc.php</span>
  388. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">/custom/phpmyadmin/theme/:/www/themes/theme/</span>
  389. </pre></div>
  390. </div>
  391. <div class="admonition seealso">
  392. <p class="first admonition-title">See also</p>
  393. <p class="last"><a class="reference internal" href="#docker-custom"><span class="std std-ref">Customizing configuration</span></a></p>
  394. </div>
  395. </div>
  396. <div class="section" id="running-behind-haproxy-in-a-subdirectory">
  397. <h3>Running behind haproxy in a subdirectory<a class="headerlink" href="#running-behind-haproxy-in-a-subdirectory" title="Permalink to this headline">¶</a></h3>
  398. <p>When you want to expose phpMyAdmin running in a Docker container in a
  399. subdirectory, you need to rewrite the request path in the server proxying the
  400. requests.</p>
  401. <p>For example using haproxy it can be done as:</p>
  402. <div class="highlight-text"><div class="highlight"><pre><span></span>frontend http
  403. bind *:80
  404. option forwardfor
  405. option http-server-close
  406. ### NETWORK restriction
  407. acl LOCALNET src 10.0.0.0/8 192.168.0.0/16 172.16.0.0/12
  408. # /phpmyadmin
  409. acl phpmyadmin path_dir /phpmyadmin
  410. use_backend phpmyadmin if phpmyadmin LOCALNET
  411. backend phpmyadmin
  412. mode http
  413. reqirep ^(GET|POST|HEAD)\ /phpmyadmin/(.*) \1\ /\2
  414. # phpMyAdmin container IP
  415. server localhost 172.30.21.21:80
  416. </pre></div>
  417. </div>
  418. <p>When using traefik, something like following should work:</p>
  419. <div class="highlight-text"><div class="highlight"><pre><span></span>defaultEntryPoints = [&quot;http&quot;]
  420. [entryPoints]
  421. [entryPoints.http]
  422. address = &quot;:80&quot;
  423. [entryPoints.http.redirect]
  424. regex = &quot;(http:\\/\\/[^\\/]+\\/([^\\?\\.]+)[^\\/])$&quot;
  425. replacement = &quot;$1/&quot;
  426. [backends]
  427. [backends.myadmin]
  428. [backends.myadmin.servers.myadmin]
  429. url=&quot;http://internal.address.to.pma&quot;
  430. [frontends]
  431. [frontends.myadmin]
  432. backend = &quot;myadmin&quot;
  433. passHostHeader = true
  434. [frontends.myadmin.routes.default]
  435. rule=&quot;PathPrefixStrip:/phpmyadmin/;AddPrefix:/&quot;
  436. </pre></div>
  437. </div>
  438. <p>You then should specify <span class="target" id="index-9"></span><a class="reference internal" href="#envvar-PMA_ABSOLUTE_URI"><code class="xref std std-envvar docutils literal"><span class="pre">PMA_ABSOLUTE_URI</span></code></a> in the docker-compose
  439. configuration:</p>
  440. <div class="highlight-yaml"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">version</span><span class="p p-Indicator">:</span> <span class="s">&#39;2&#39;</span>
  441. <span class="l l-Scalar l-Scalar-Plain">services</span><span class="p p-Indicator">:</span>
  442. <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span><span class="p p-Indicator">:</span>
  443. <span class="l l-Scalar l-Scalar-Plain">restart</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">always</span>
  444. <span class="l l-Scalar l-Scalar-Plain">image</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin/phpmyadmin</span>
  445. <span class="l l-Scalar l-Scalar-Plain">container_name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  446. <span class="l l-Scalar l-Scalar-Plain">hostname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">phpmyadmin</span>
  447. <span class="l l-Scalar l-Scalar-Plain">domainname</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">example.com</span>
  448. <span class="l l-Scalar l-Scalar-Plain">ports</span><span class="p p-Indicator">:</span>
  449. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">8000:80</span>
  450. <span class="l l-Scalar l-Scalar-Plain">environment</span><span class="p p-Indicator">:</span>
  451. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_HOSTS=172.26.36.7,172.26.36.8,172.26.36.9,172.26.36.10</span>
  452. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_VERBOSES=production-db1,production-db2,dev-db1,dev-db2</span>
  453. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_USER=root</span>
  454. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_PASSWORD=</span>
  455. <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">PMA_ABSOLUTE_URI=http://example.com/phpmyadmin/</span>
  456. </pre></div>
  457. </div>
  458. </div>
  459. </div>
  460. <div class="section" id="quick-install">
  461. <span id="id1"></span><h2>Quick Install<a class="headerlink" href="#quick-install" title="Permalink to this headline">¶</a></h2>
  462. <ol class="arabic simple">
  463. <li>Choose an appropriate distribution kit from the phpmyadmin.net
  464. Downloads page. Some kits contain only the English messages, others
  465. contain all languages. We&#8217;ll assume you chose a kit whose name
  466. looks like <code class="docutils literal"><span class="pre">phpMyAdmin-x.x.x</span> <span class="pre">-all-languages.tar.gz</span></code>.</li>
  467. <li>Ensure you have downloaded a genuine archive, see <a class="reference internal" href="#verify"><span class="std std-ref">Verifying phpMyAdmin releases</span></a>.</li>
  468. <li>Untar or unzip the distribution (be sure to unzip the subdirectories):
  469. <code class="docutils literal"><span class="pre">tar</span> <span class="pre">-xzvf</span> <span class="pre">phpMyAdmin_x.x.x-all-languages.tar.gz</span></code> in your
  470. webserver&#8217;s document root. If you don&#8217;t have direct access to your
  471. document root, put the files in a directory on your local machine,
  472. and, after step 4, transfer the directory on your web server using,
  473. for example, ftp.</li>
  474. <li>Ensure that all the scripts have the appropriate owner (if PHP is
  475. running in safe mode, having some scripts with an owner different from
  476. the owner of other scripts will be a problem). See <a class="reference internal" href="faq.html#faq4-2"><span class="std std-ref">4.2 What&#8217;s the preferred way of making phpMyAdmin secure against evil access?</span></a> and
  477. <a class="reference internal" href="faq.html#faq1-26"><span class="std std-ref">1.26 I just installed phpMyAdmin in my document root of IIS but I get the error &#8220;No input file specified&#8221; when trying to run phpMyAdmin.</span></a> for suggestions.</li>
  478. <li>Now you must configure your installation. There are two methods that
  479. can be used. Traditionally, users have hand-edited a copy of
  480. <code class="file docutils literal"><span class="pre">config.inc.php</span></code>, but now a wizard-style setup script is provided
  481. for those who prefer a graphical installation. Creating a
  482. <code class="file docutils literal"><span class="pre">config.inc.php</span></code> is still a quick way to get started and needed for
  483. some advanced features.</li>
  484. </ol>
  485. <div class="section" id="manually-creating-the-file">
  486. <h3>Manually creating the file<a class="headerlink" href="#manually-creating-the-file" title="Permalink to this headline">¶</a></h3>
  487. <p>To manually create the file, simply use your text editor to create the
  488. file <code class="file docutils literal"><span class="pre">config.inc.php</span></code> (you can copy <code class="file docutils literal"><span class="pre">config.sample.inc.php</span></code> to get
  489. a minimal configuration file) in the main (top-level) phpMyAdmin
  490. directory (the one that contains <code class="file docutils literal"><span class="pre">index.php</span></code>). phpMyAdmin first
  491. loads <code class="file docutils literal"><span class="pre">libraries/config.default.php</span></code> and then overrides those values
  492. with anything found in <code class="file docutils literal"><span class="pre">config.inc.php</span></code>. If the default value is
  493. okay for a particular setting, there is no need to include it in
  494. <code class="file docutils literal"><span class="pre">config.inc.php</span></code>. You&#8217;ll probably need only a few directives to get going; a
  495. simple configuration may look like this:</p>
  496. <div class="highlight-xml+php"><div class="highlight"><pre><span></span><span class="cp">&lt;?php</span>
  497. <span class="c1">// use here a value of your choice at least 32 chars long</span>
  498. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;blowfish_secret&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;1{dd0`&lt;Q),5XP_:R9UK%%8\&quot;EEcyH#{o&#39;</span><span class="p">;</span>
  499. <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
  500. <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
  501. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;auth_type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;cookie&#39;</span><span class="p">;</span>
  502. <span class="c1">// if you insist on &quot;root&quot; having no password:</span>
  503. <span class="c1">// $cfg[&#39;Servers&#39;][$i][&#39;AllowNoPassword&#39;] = true; `</span>
  504. <span class="cp">?&gt;</span>
  505. </pre></div>
  506. </div>
  507. <p>Or, if you prefer to not be prompted every time you log in:</p>
  508. <div class="highlight-xml+php"><div class="highlight"><pre><span></span><span class="cp">&lt;?php</span>
  509. <span class="nv">$i</span><span class="o">=</span><span class="mi">0</span><span class="p">;</span>
  510. <span class="nv">$i</span><span class="o">++</span><span class="p">;</span>
  511. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;root&#39;</span><span class="p">;</span>
  512. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;cbb74bc&#39;</span><span class="p">;</span> <span class="c1">// use here your password</span>
  513. <span class="nv">$cfg</span><span class="p">[</span><span class="s1">&#39;Servers&#39;</span><span class="p">][</span><span class="nv">$i</span><span class="p">][</span><span class="s1">&#39;auth_type&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="s1">&#39;config&#39;</span><span class="p">;</span>
  514. <span class="cp">?&gt;</span>
  515. </pre></div>
  516. </div>
  517. <div class="admonition warning">
  518. <p class="first admonition-title">Warning</p>
  519. <p class="last">Storing passwords in the configuration is insecure as anybody can then
  520. manipulate your database.</p>
  521. </div>
  522. <p>For a full explanation of possible configuration values, see the
  523. <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a> of this document.</p>
  524. </div>
  525. <div class="section" id="using-setup-script">
  526. <span id="setup-script"></span><span id="index-10"></span><h3>Using Setup script<a class="headerlink" href="#using-setup-script" title="Permalink to this headline">¶</a></h3>
  527. <p>Instead of manually editing <code class="file docutils literal"><span class="pre">config.inc.php</span></code>, you can use phpMyAdmin&#8217;s
  528. setup feature. The file can be generated using the setup and you can download it
  529. for upload to the server.</p>
  530. <p>Next, open your browser and visit the location where you installed phpMyAdmin,
  531. with the <code class="docutils literal"><span class="pre">/setup</span></code> suffix. The changes are not saved to the server, you need to
  532. use the <span class="guilabel">Download</span> button to save them to your computer and then upload
  533. to the server.</p>
  534. <p>Now the file is ready to be used. You can choose to review or edit the
  535. file with your favorite editor, if you prefer to set some advanced
  536. options which the setup script does not provide.</p>
  537. <ol class="arabic simple">
  538. <li>If you are using the <code class="docutils literal"><span class="pre">auth_type</span></code> &#8220;config&#8221;, it is suggested that you
  539. protect the phpMyAdmin installation directory because using config
  540. does not require a user to enter a password to access the phpMyAdmin
  541. installation. Use of an alternate authentication method is
  542. recommended, for example with HTTP–AUTH in a <a class="reference internal" href="glossary.html#term-htaccess"><span class="xref std std-term">.htaccess</span></a> file or switch to using
  543. <code class="docutils literal"><span class="pre">auth_type</span></code> cookie or http. See the <a class="reference internal" href="faq.html#faqmultiuser"><span class="std std-ref">ISPs, multi-user installations</span></a>
  544. for additional information, especially <a class="reference internal" href="faq.html#faq4-4"><span class="std std-ref">4.4 phpMyAdmin always gives &#8220;Access denied&#8221; when using HTTP authentication.</span></a>.</li>
  545. <li>Open the main phpMyAdmin directory in your browser.
  546. phpMyAdmin should now display a welcome screen and your databases, or
  547. a login dialog if using <a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a> or
  548. cookie authentication mode.</li>
  549. </ol>
  550. <div class="section" id="setup-script-on-debian-ubuntu-and-derivatives">
  551. <span id="debian-setup"></span><h4>Setup script on Debian, Ubuntu and derivatives<a class="headerlink" href="#setup-script-on-debian-ubuntu-and-derivatives" title="Permalink to this headline">¶</a></h4>
  552. <p>Debian and Ubuntu have changed way how setup is enabled and disabled, in a way
  553. that single command has to be executed for either of these.</p>
  554. <p>To allow editing configuration invoke:</p>
  555. <div class="highlight-sh"><div class="highlight"><pre><span></span>/usr/sbin/pma-configure
  556. </pre></div>
  557. </div>
  558. <p>To block editing configuration invoke:</p>
  559. <div class="highlight-sh"><div class="highlight"><pre><span></span>/usr/sbin/pma-secure
  560. </pre></div>
  561. </div>
  562. </div>
  563. <div class="section" id="setup-script-on-opensuse">
  564. <h4>Setup script on openSUSE<a class="headerlink" href="#setup-script-on-opensuse" title="Permalink to this headline">¶</a></h4>
  565. <p>Some openSUSE releases do not include setup script in the package. In case you
  566. want to generate configuration on these you can either download original
  567. package from &lt;<a class="reference external" href="https://www.phpmyadmin.net/">https://www.phpmyadmin.net/</a>&gt; or use setup script on our demo
  568. server: &lt;<a class="reference external" href="https://demo.phpmyadmin.net/master/setup/">https://demo.phpmyadmin.net/master/setup/</a>&gt;.</p>
  569. </div>
  570. </div>
  571. </div>
  572. <div class="section" id="verifying-phpmyadmin-releases">
  573. <span id="verify"></span><h2>Verifying phpMyAdmin releases<a class="headerlink" href="#verifying-phpmyadmin-releases" title="Permalink to this headline">¶</a></h2>
  574. <p>Since July 2015 all phpMyAdmin releases are cryptographically signed by the
  575. releasing developer, who through January 2016 was Marc Delisle. His key id is
  576. 0xFEFC65D181AF644A, his PGP fingerprint is:</p>
  577. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">436F F188 4B1A 0C3F DCBF 0D79 FEFC 65D1 81AF 644A</span>
  578. </pre></div>
  579. </div>
  580. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/lem9">https://keybase.io/lem9</a>&gt;.</p>
  581. <p>Beginning in January 2016, the release manager is Isaac Bennetch. His key id is
  582. 0xCE752F178259BD92, and his PGP fingerprint is:</p>
  583. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92</span>
  584. </pre></div>
  585. </div>
  586. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/ibennetch">https://keybase.io/ibennetch</a>&gt;.</p>
  587. <p>Some additional downloads (for example themes) might be signed by Michal Čihař. His key id is
  588. 0x9C27B31342B7511D, and his PGP fingerprint is:</p>
  589. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="go">63CB 1DF1 EF12 CF2A C0EE 5A32 9C27 B313 42B7 511D</span>
  590. </pre></div>
  591. </div>
  592. <p>and you can get more identification information from &lt;<a class="reference external" href="https://keybase.io/nijel">https://keybase.io/nijel</a>&gt;.</p>
  593. <p>You should verify that the signature matches the archive you have downloaded.
  594. This way you can be sure that you are using the same code that was released.
  595. You should also verify the date of the signature to make sure that you
  596. downloaded the latest version.</p>
  597. <p>Each archive is accompanied with <code class="docutils literal"><span class="pre">.asc</span></code> files which contains the PGP signature
  598. for it. Once you have both of them in the same folder, you can verify the signature:</p>
  599. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
  600. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  601. <span class="go">gpg: Can&#39;t check signature: public key not found</span>
  602. </pre></div>
  603. </div>
  604. <p>As you can see gpg complains that it does not know the public key. At this
  605. point you should do one of the following steps:</p>
  606. <ul class="simple">
  607. <li>Download the keyring from <a class="reference external" href="https://files.phpmyadmin.net/phpmyadmin.keyring">our download server</a>, then import it with:</li>
  608. </ul>
  609. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --import phpmyadmin.keyring
  610. </pre></div>
  611. </div>
  612. <ul class="simple">
  613. <li>Download and import the key from one of the key servers:</li>
  614. </ul>
  615. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --keyserver hkp://pgp.mit.edu --recv-keys 3D06A59ECE730EB71B511C17CE752F178259BD92
  616. <span class="go">gpg: requesting key 8259BD92 from hkp server pgp.mit.edu</span>
  617. <span class="go">gpg: key 8259BD92: public key &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; imported</span>
  618. <span class="go">gpg: no ultimately trusted keys found</span>
  619. <span class="go">gpg: Total number processed: 1</span>
  620. <span class="go">gpg: imported: 1 (RSA: 1)</span>
  621. </pre></div>
  622. </div>
  623. <p>This will improve the situation a bit - at this point you can verify that the
  624. signature from the given key is correct but you still can not trust the name used
  625. in the key:</p>
  626. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
  627. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  628. <span class="go">gpg: Good signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot;</span>
  629. <span class="go">gpg: aka &quot;Isaac Bennetch &lt;isaac@bennetch.org&gt;&quot;</span>
  630. <span class="go">gpg: WARNING: This key is not certified with a trusted signature!</span>
  631. <span class="go">gpg: There is no indication that the signature belongs to the owner.</span>
  632. <span class="go">Primary key fingerprint: 3D06 A59E CE73 0EB7 1B51 1C17 CE75 2F17 8259 BD92</span>
  633. </pre></div>
  634. </div>
  635. <p>The problem here is that anybody could issue the key with this name. You need to
  636. ensure that the key is actually owned by the mentioned person. The GNU Privacy
  637. Handbook covers this topic in the chapter <a class="reference external" href="https://www.gnupg.org/gph/en/manual.html#AEN335">Validating other keys on your public
  638. keyring</a>. The most reliable method is to meet the developer in person and
  639. exchange key fingerprints, however you can also rely on the web of trust. This way
  640. you can trust the key transitively though signatures of others, who have met
  641. the developer in person. For example you can see how <a class="reference external" href="https://pgp.cs.uu.nl/paths/79be3e4300411886/to/ce752f178259bd92.html">Isaac&#8217;s key links to
  642. Linus&#8217;s key</a>.</p>
  643. <p>Once the key is trusted, the warning will not occur:</p>
  644. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
  645. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  646. <span class="go">gpg: Good signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; [full]</span>
  647. </pre></div>
  648. </div>
  649. <p>Should the signature be invalid (the archive has been changed), you would get a
  650. clear error regardless of the fact that the key is trusted or not:</p>
  651. <div class="highlight-console"><div class="highlight"><pre><span></span><span class="gp">$</span> gpg --verify phpMyAdmin-4.5.4.1-all-languages.zip.asc
  652. <span class="go">gpg: Signature made Fri 29 Jan 2016 08:59:37 AM EST using RSA key ID 8259BD92</span>
  653. <span class="go">gpg: BAD signature from &quot;Isaac Bennetch &lt;bennetch@gmail.com&gt;&quot; [unknown]</span>
  654. </pre></div>
  655. </div>
  656. </div>
  657. <div class="section" id="phpmyadmin-configuration-storage">
  658. <span id="linked-tables"></span><span id="index-11"></span><h2>phpMyAdmin configuration storage<a class="headerlink" href="#phpmyadmin-configuration-storage" title="Permalink to this headline">¶</a></h2>
  659. <div class="versionchanged">
  660. <p><span class="versionmodified">Changed in version 3.4.0: </span>Prior to phpMyAdmin 3.4.0 this was called Linked Tables Infrastructure, but
  661. the name was changed due to extended scope of the storage.</p>
  662. </div>
  663. <p>For a whole set of additional features (<a class="reference internal" href="bookmarks.html#bookmarks"><span class="std std-ref">Bookmarks</span></a>, comments, <a class="reference internal" href="glossary.html#term-sql"><span class="xref std std-term">SQL</span></a>-history,
  664. tracking mechanism, <a class="reference internal" href="glossary.html#term-pdf"><span class="xref std std-term">PDF</span></a>-generation, <a class="reference internal" href="transformations.html#transformations"><span class="std std-ref">Transformations</span></a>, <a class="reference internal" href="relations.html#relations"><span class="std std-ref">Relations</span></a>
  665. etc.) you need to create a set of special tables. Those tables can be located
  666. in your own database, or in a central database for a multi-user installation
  667. (this database would then be accessed by the controluser, so no other user
  668. should have rights to it).</p>
  669. <div class="section" id="zero-configuration">
  670. <span id="zeroconf"></span><h3>Zero configuration<a class="headerlink" href="#zero-configuration" title="Permalink to this headline">¶</a></h3>
  671. <p>In many cases, this database structure can be automatically created and
  672. configured. This is called “Zero Configuration” mode and can be particularly
  673. useful in shared hosting situations. “Zeroconf” mode is on by default, to
  674. disable set <span class="target" id="index-12"></span><a class="reference internal" href="config.html#cfg_ZeroConf"><code class="xref config config-option docutils literal"><span class="pre">$cfg['ZeroConf']</span></code></a> to false.</p>
  675. <p>The following three scenarios are covered by the Zero Configuration mode:</p>
  676. <ul class="simple">
  677. <li>When entering a database where the configuration storage tables are not
  678. present, phpMyAdmin offers to create them from the Operations tab.</li>
  679. <li>When entering a database where the tables do already exist, the software
  680. automatically detects this and begins using them. This is the most common
  681. situation; after the tables are initially created automatically they are
  682. continually used without disturbing the user; this is also most useful on
  683. shared hosting where the user is not able to edit <code class="file docutils literal"><span class="pre">config.inc.php</span></code> and
  684. usually the user only has access to one database.</li>
  685. <li>When having access to multiple databases, if the user first enters the
  686. database containing the configuration storage tables then switches to
  687. another database,
  688. phpMyAdmin continues to use the tables from the first database; the user is
  689. not prompted to create more tables in the new database.</li>
  690. </ul>
  691. </div>
  692. <div class="section" id="manual-configuration">
  693. <h3>Manual configuration<a class="headerlink" href="#manual-configuration" title="Permalink to this headline">¶</a></h3>
  694. <p>Please look at your <code class="docutils literal"><span class="pre">./sql/</span></code> directory, where you should find a
  695. file called <em>create_tables.sql</em>. (If you are using a Windows server,
  696. pay special attention to <a class="reference internal" href="faq.html#faq1-23"><span class="std std-ref">1.23 I&#8217;m running MySQL on a Win32 machine. Each time I create a new table the table and column names are changed to lowercase!</span></a>).</p>
  697. <p>If you already had this infrastructure and:</p>
  698. <ul class="simple">
  699. <li>upgraded to MySQL 4.1.2 or newer, please use
  700. <code class="file docutils literal"><span class="pre">sql/upgrade_tables_mysql_4_1_2+.sql</span></code>.</li>
  701. <li>upgraded to phpMyAdmin 4.3.0 or newer from 2.5.0 or newer (&lt;= 4.2.x),
  702. please use <code class="file docutils literal"><span class="pre">sql/upgrade_column_info_4_3_0+.sql</span></code>.</li>
  703. <li>upgraded to phpMyAdmin 4.7.0 or newer from 4.3.0 or newer,
  704. please use <code class="file docutils literal"><span class="pre">sql/upgrade_tables_4_7_0+.sql</span></code>.</li>
  705. </ul>
  706. <p>and then create new tables by importing <code class="file docutils literal"><span class="pre">sql/create_tables.sql</span></code>.</p>
  707. <p>You can use your phpMyAdmin to create the tables for you. Please be
  708. aware that you may need special (administrator) privileges to create
  709. the database and tables, and that the script may need some tuning,
  710. depending on the database name.</p>
  711. <p>After having imported the <code class="file docutils literal"><span class="pre">sql/create_tables.sql</span></code> file, you
  712. should specify the table names in your <code class="file docutils literal"><span class="pre">config.inc.php</span></code> file. The
  713. directives used for that can be found in the <a class="reference internal" href="config.html#config"><span class="std std-ref">Configuration</span></a>.</p>
  714. <p>You will also need to have a controluser
  715. (<span class="target" id="index-13"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controluser']</span></code></a> and
  716. <span class="target" id="index-14"></span><a class="reference internal" href="config.html#cfg_Servers_controlpass"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controlpass']</span></code></a> settings)
  717. with the proper rights to those tables. For example you can create it
  718. using following statement:</p>
  719. <div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">GRANT</span> <span class="k">SELECT</span><span class="p">,</span> <span class="k">INSERT</span><span class="p">,</span> <span class="k">UPDATE</span><span class="p">,</span> <span class="k">DELETE</span> <span class="k">ON</span> <span class="o">&lt;</span><span class="n">pma_db</span><span class="o">&gt;</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="s1">&#39;pma&#39;</span><span class="o">@</span><span class="s1">&#39;localhost&#39;</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;pmapass&#39;</span><span class="p">;</span>
  720. </pre></div>
  721. </div>
  722. </div>
  723. </div>
  724. <div class="section" id="upgrading-from-an-older-version">
  725. <span id="upgrading"></span><h2>Upgrading from an older version<a class="headerlink" href="#upgrading-from-an-older-version" title="Permalink to this headline">¶</a></h2>
  726. <div class="admonition warning">
  727. <p class="first admonition-title">Warning</p>
  728. <p><strong>Never</strong> extract the new version over an existing installation of
  729. phpMyAdmin, always first remove the old files keeping just the
  730. configuration.</p>
  731. <p class="last">This way you will not leave old no longer working code in the directory,
  732. which can have severe security implications or can cause various breakages.</p>
  733. </div>
  734. <p>Simply copy <code class="file docutils literal"><span class="pre">config.inc.php</span></code> from your previous installation into
  735. the newly unpacked one. Configuration files from old versions may
  736. require some tweaking as some options have been changed or removed.
  737. For compatibility with PHP 5.3 and later, remove a
  738. <code class="docutils literal"><span class="pre">set_magic_quotes_runtime(0);</span></code> statement that you might find near
  739. the end of your configuration file.</p>
  740. <p>You should <strong>not</strong> copy <code class="file docutils literal"><span class="pre">libraries/config.default.php</span></code> over
  741. <code class="file docutils literal"><span class="pre">config.inc.php</span></code> because the default configuration file is version-
  742. specific.</p>
  743. <p>The complete upgrade can be performed in few simple steps:</p>
  744. <ol class="arabic simple">
  745. <li>Download the latest phpMyAdmin version from &lt;<a class="reference external" href="https://www.phpmyadmin.net/downloads/">https://www.phpmyadmin.net/downloads/</a>&gt;.</li>
  746. <li>Rename existing phpMyAdmin folder (for example to <code class="docutils literal"><span class="pre">phpmyadmin-old</span></code>).</li>
  747. <li>Unpack freshly donwloaded phpMyAdmin to desired location (for example <code class="docutils literal"><span class="pre">phpmyadmin</span></code>).</li>
  748. <li>Copy <code class="file docutils literal"><span class="pre">config.inc.php`</span></code> from old location (<code class="docutils literal"><span class="pre">phpmyadmin-old</span></code>) to new one (<code class="docutils literal"><span class="pre">phpmyadmin</span></code>).</li>
  749. <li>Test that everything works properly.</li>
  750. <li>Remove backup of previous version (<code class="docutils literal"><span class="pre">phpmyadmin-old</span></code>).</li>
  751. </ol>
  752. <p>If you have upgraded your MySQL server from a version previous to 4.1.2 to
  753. version 5.x or newer and if you use the phpMyAdmin configuration storage, you
  754. should run the <a class="reference internal" href="glossary.html#term-sql"><span class="xref std std-term">SQL</span></a> script found in
  755. <code class="file docutils literal"><span class="pre">sql/upgrade_tables_mysql_4_1_2+.sql</span></code>.</p>
  756. <p>If you have upgraded your phpMyAdmin to 4.3.0 or newer from 2.5.0 or
  757. newer (&lt;= 4.2.x) and if you use the phpMyAdmin configuration storage, you
  758. should run the <a class="reference internal" href="glossary.html#term-sql"><span class="xref std std-term">SQL</span></a> script found in
  759. <code class="file docutils literal"><span class="pre">sql/upgrade_column_info_4_3_0+.sql</span></code>.</p>
  760. <p>Do not forget to clear the browser cache and to empty the old session by
  761. logging out and logging in again.</p>
  762. </div>
  763. <div class="section" id="using-authentication-modes">
  764. <span id="authentication-modes"></span><span id="index-15"></span><h2>Using authentication modes<a class="headerlink" href="#using-authentication-modes" title="Permalink to this headline">¶</a></h2>
  765. <p><a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a> and cookie authentication modes are recommended in a <strong>multi-user
  766. environment</strong> where you want to give users access to their own database and
  767. don&#8217;t want them to play around with others. Nevertheless be aware that MS
  768. Internet Explorer seems to be really buggy about cookies, at least till version
  769. 6. Even in a <strong>single-user environment</strong>, you might prefer to use <a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a>
  770. or cookie mode so that your user/password pair are not in clear in the
  771. configuration file.</p>
  772. <p><a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a> and cookie authentication
  773. modes are more secure: the MySQL login information does not need to be
  774. set in the phpMyAdmin configuration file (except possibly for the
  775. <span class="target" id="index-16"></span><a class="reference internal" href="config.html#cfg_Servers_controluser"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['controluser']</span></code></a>).
  776. However, keep in mind that the password travels in plain text, unless
  777. you are using the HTTPS protocol. In cookie mode, the password is
  778. stored, encrypted with the AES algorithm, in a temporary cookie.</p>
  779. <p>Then each of the <em>true</em> users should be granted a set of privileges
  780. on a set of particular databases. Normally you shouldn&#8217;t give global
  781. privileges to an ordinary user, unless you understand the impact of those
  782. privileges (for example, you are creating a superuser).
  783. For example, to grant the user <em>real_user</em> with all privileges on
  784. the database <em>user_base</em>:</p>
  785. <div class="highlight-mysql"><div class="highlight"><pre><span></span><span class="k">GRANT</span> <span class="k">ALL</span> <span class="n">PRIVILEGES</span> <span class="k">ON</span> <span class="n">user_base</span><span class="p">.</span><span class="o">*</span> <span class="k">TO</span> <span class="s1">&#39;real_user&#39;</span><span class="o">@</span><span class="n">localhost</span> <span class="n">IDENTIFIED</span> <span class="k">BY</span> <span class="s1">&#39;real_password&#39;</span><span class="p">;</span>
  786. </pre></div>
  787. </div>
  788. <p>What the user may now do is controlled entirely by the MySQL user management
  789. system. With HTTP or cookie authentication mode, you don&#8217;t need to fill the
  790. user/password fields inside the <span class="target" id="index-17"></span><a class="reference internal" href="config.html#cfg_Servers"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers']</span></code></a>.</p>
  791. <div class="admonition seealso">
  792. <p class="first admonition-title">See also</p>
  793. <p class="last"><a class="reference internal" href="faq.html#faq1-32"><span class="std std-ref">1.32 Can I use HTTP authentication with IIS?</span></a>,
  794. <a class="reference internal" href="faq.html#faq1-35"><span class="std std-ref">1.35 Can I use HTTP authentication with Apache CGI?</span></a>,
  795. <a class="reference internal" href="faq.html#faq4-1"><span class="std std-ref">4.1 I&#8217;m an ISP. Can I setup one central copy of phpMyAdmin or do I need to install it for each customer?</span></a>,
  796. <a class="reference internal" href="faq.html#faq4-2"><span class="std std-ref">4.2 What&#8217;s the preferred way of making phpMyAdmin secure against evil access?</span></a>,
  797. <a class="reference internal" href="faq.html#faq4-3"><span class="std std-ref">4.3 I get errors about not being able to include a file in /lang or in /libraries.</span></a></p>
  798. </div>
  799. <div class="section" id="http-authentication-mode">
  800. <span id="auth-http"></span><span id="index-18"></span><h3>HTTP authentication mode<a class="headerlink" href="#http-authentication-mode" title="Permalink to this headline">¶</a></h3>
  801. <ul>
  802. <li><p class="first">Uses <a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a> Basic authentication
  803. method and allows you to log in as any valid MySQL user.</p>
  804. </li>
  805. <li><p class="first">Is supported with most PHP configurations. For <a class="reference internal" href="glossary.html#term-iis"><span class="xref std std-term">IIS</span></a> (<a class="reference internal" href="glossary.html#term-isapi"><span class="xref std std-term">ISAPI</span></a>)
  806. support using <a class="reference internal" href="glossary.html#term-cgi"><span class="xref std std-term">CGI</span></a> PHP see <a class="reference internal" href="faq.html#faq1-32"><span class="std std-ref">1.32 Can I use HTTP authentication with IIS?</span></a>, for using with Apache
  807. <a class="reference internal" href="glossary.html#term-cgi"><span class="xref std std-term">CGI</span></a> see <a class="reference internal" href="faq.html#faq1-35"><span class="std std-ref">1.35 Can I use HTTP authentication with Apache CGI?</span></a>.</p>
  808. </li>
  809. <li><p class="first">When PHP is running under Apache&#8217;s <a class="reference internal" href="glossary.html#term-mod-proxy-fcgi"><span class="xref std std-term">mod_proxy_fcgi</span></a> (e.g. with PHP-FPM),
  810. <code class="docutils literal"><span class="pre">Authorization</span></code> headers are not passed to the underlying FCGI application,
  811. such that your credentials will not reach the application. In this case, you can
  812. add the following configuration directive:</p>
  813. <div class="highlight-apache"><div class="highlight"><pre><span></span><span class="nb">SetEnvIf</span> Authorization <span class="s2">&quot;(.*)&quot;</span> HTTP_AUTHORIZATION=$1
  814. </pre></div>
  815. </div>
  816. </li>
  817. <li><p class="first">See also <a class="reference internal" href="faq.html#faq4-4"><span class="std std-ref">4.4 phpMyAdmin always gives &#8220;Access denied&#8221; when using HTTP authentication.</span></a> about not using the <a class="reference internal" href="glossary.html#term-htaccess"><span class="xref std std-term">.htaccess</span></a> mechanism along with
  818. &#8216;<a class="reference internal" href="glossary.html#term-http"><span class="xref std std-term">HTTP</span></a>&#8216; authentication mode.</p>
  819. </li>
  820. </ul>
  821. <div class="admonition note">
  822. <p class="first admonition-title">Note</p>
  823. <p class="last">There is no way to do proper logout in HTTP authentication, most browsers
  824. will remember credentials until there is no different successful
  825. authentication. Because of this this method has limitation that you can not
  826. login with same user after logout.</p>
  827. </div>
  828. </div>
  829. <div class="section" id="cookie-authentication-mode">
  830. <span id="cookie"></span><span id="index-19"></span><h3>Cookie authentication mode<a class="headerlink" href="#cookie-authentication-mode" title="Permalink to this headline">¶</a></h3>
  831. <ul class="simple">
  832. <li>Username and password are stored in cookies during the session and password
  833. is deleted when it ends.</li>
  834. <li>With this mode, the user can truly log out of phpMyAdmin and log
  835. back in with the same username (this is not possible with <a class="reference internal" href="#auth-http"><span class="std std-ref">HTTP authentication mode</span></a>).</li>
  836. <li>If you want to allow users to enter any hostname to connect (rather than only
  837. servers that are configured in <code class="file docutils literal"><span class="pre">config.inc.php</span></code>),
  838. see the <span class="target" id="index-20"></span><a class="reference internal" href="config.html#cfg_AllowArbitraryServer"><code class="xref config config-option docutils literal"><span class="pre">$cfg['AllowArbitraryServer']</span></code></a> directive.</li>
  839. <li>As mentioned in the <a class="reference internal" href="require.html#require"><span class="std std-ref">Requirements</span></a> section, having the <code class="docutils literal"><span class="pre">openssl</span></code> extension
  840. will speed up access considerably, but is not required.</li>
  841. </ul>
  842. </div>
  843. <div class="section" id="signon-authentication-mode">
  844. <span id="auth-signon"></span><span id="index-21"></span><h3>Signon authentication mode<a class="headerlink" href="#signon-authentication-mode" title="Permalink to this headline">¶</a></h3>
  845. <ul class="simple">
  846. <li>This mode is a convenient way of using credentials from another
  847. application to authenticate to phpMyAdmin to implement single signon
  848. solution.</li>
  849. <li>The other application has to store login information into session
  850. data (see <span class="target" id="index-22"></span><a class="reference internal" href="config.html#cfg_Servers_SignonSession"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonSession']</span></code></a> and
  851. <span class="target" id="index-23"></span><a class="reference internal" href="config.html#cfg_Servers_SignonCookieParams"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonCookieParams']</span></code></a>) or you
  852. need to implement script to return the credentials (see
  853. <span class="target" id="index-24"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>).</li>
  854. <li>When no credentials are available, the user is being redirected to
  855. <span class="target" id="index-25"></span><a class="reference internal" href="config.html#cfg_Servers_SignonURL"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonURL']</span></code></a>, where you should handle
  856. the login process.</li>
  857. </ul>
  858. <p>The very basic example of saving credentials in a session is available as
  859. <code class="file docutils literal"><span class="pre">examples/signon.php</span></code>:</p>
  860. <div class="highlight-php"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  861. <span class="cm">/* vim: set expandtab sw=4 ts=4 sts=4: */</span>
  862. <span class="sd">/**</span>
  863. <span class="sd"> * Single signon for phpMyAdmin</span>
  864. <span class="sd"> *</span>
  865. <span class="sd"> * This is just example how to use session based single signon with</span>
  866. <span class="sd"> * phpMyAdmin, it is not intended to be perfect code and look, only</span>
  867. <span class="sd"> * shows how you can integrate this functionality in your application.</span>
  868. <span class="sd"> *</span>
  869. <span class="sd"> * @package PhpMyAdmin</span>
  870. <span class="sd"> * @subpackage Example</span>
  871. <span class="sd"> */</span>
  872. <span class="cm">/* Use cookies for session */</span>
  873. <span class="nb">ini_set</span><span class="p">(</span><span class="s1">&#39;session.use_cookies&#39;</span><span class="p">,</span> <span class="s1">&#39;true&#39;</span><span class="p">);</span>
  874. <span class="cm">/* Change this to true if using phpMyAdmin over https */</span>
  875. <span class="nv">$secure_cookie</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
  876. <span class="cm">/* Need to have cookie visible from parent directory */</span>
  877. <span class="nb">session_set_cookie_params</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$secure_cookie</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
  878. <span class="cm">/* Create signon session */</span>
  879. <span class="nv">$session_name</span> <span class="o">=</span> <span class="s1">&#39;SignonSession&#39;</span><span class="p">;</span>
  880. <span class="nb">session_name</span><span class="p">(</span><span class="nv">$session_name</span><span class="p">);</span>
  881. <span class="c1">// Uncomment and change the following line to match your $cfg[&#39;SessionSavePath&#39;]</span>
  882. <span class="c1">//session_save_path(&#39;/foobar&#39;);</span>
  883. <span class="o">@</span><span class="nb">session_start</span><span class="p">();</span>
  884. <span class="cm">/* Was data posted? */</span>
  885. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">]))</span> <span class="p">{</span>
  886. <span class="cm">/* Store there credentials */</span>
  887. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;user&#39;</span><span class="p">];</span>
  888. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;password&#39;</span><span class="p">];</span>
  889. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_host&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;host&#39;</span><span class="p">];</span>
  890. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_port&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;port&#39;</span><span class="p">];</span>
  891. <span class="cm">/* Update another field of server configuration */</span>
  892. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_cfgupdate&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;verbose&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;Signon test&#39;</span><span class="p">);</span>
  893. <span class="nv">$id</span> <span class="o">=</span> <span class="nb">session_id</span><span class="p">();</span>
  894. <span class="cm">/* Close that session */</span>
  895. <span class="o">@</span><span class="nb">session_write_close</span><span class="p">();</span>
  896. <span class="cm">/* Redirect to phpMyAdmin (should use absolute URL here!) */</span>
  897. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Location: ../index.php&#39;</span><span class="p">);</span>
  898. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  899. <span class="cm">/* Show simple form */</span>
  900. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Content-Type: text/html; charset=utf-8&#39;</span><span class="p">);</span>
  901. <span class="k">echo</span> <span class="s1">&#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&#39;</span> <span class="p">,</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  902. <span class="cp">?&gt;</span><span class="x"></span>
  903. <span class="x"> &lt;!DOCTYPE HTML&gt;</span>
  904. <span class="x"> &lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;</span>
  905. <span class="x"> &lt;head&gt;</span>
  906. <span class="x"> &lt;link rel=&quot;icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</span>
  907. <span class="x"> &lt;link rel=&quot;shortcut icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</span>
  908. <span class="x"> &lt;meta charset=&quot;utf-8&quot; /&gt;</span>
  909. <span class="x"> &lt;title&gt;phpMyAdmin single signon example&lt;/title&gt;</span>
  910. <span class="x"> &lt;/head&gt;</span>
  911. <span class="x"> &lt;body&gt;</span>
  912. <span class="x"> </span><span class="cp">&lt;?php</span>
  913. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">]))</span> <span class="p">{</span>
  914. <span class="k">echo</span> <span class="s1">&#39;&lt;p class=&quot;error&quot;&gt;&#39;</span><span class="p">;</span>
  915. <span class="k">echo</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">];</span>
  916. <span class="k">echo</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">;</span>
  917. <span class="p">}</span>
  918. <span class="cp">?&gt;</span><span class="x"></span>
  919. <span class="x"> &lt;form action=&quot;signon.php&quot; method=&quot;post&quot;&gt;</span>
  920. <span class="x"> Username: &lt;input type=&quot;text&quot; name=&quot;user&quot; /&gt;&lt;br /&gt;</span>
  921. <span class="x"> Password: &lt;input type=&quot;password&quot; name=&quot;password&quot; /&gt;&lt;br /&gt;</span>
  922. <span class="x"> Host: (will use the one from config.inc.php by default)</span>
  923. <span class="x"> &lt;input type=&quot;text&quot; name=&quot;host&quot; /&gt;&lt;br /&gt;</span>
  924. <span class="x"> Port: (will use the one from config.inc.php by default)</span>
  925. <span class="x"> &lt;input type=&quot;text&quot; name=&quot;port&quot; /&gt;&lt;br /&gt;</span>
  926. <span class="x"> &lt;input type=&quot;submit&quot; /&gt;</span>
  927. <span class="x"> &lt;/form&gt;</span>
  928. <span class="x"> &lt;/body&gt;</span>
  929. <span class="x"> &lt;/html&gt;</span>
  930. <span class="x"> </span><span class="cp">&lt;?php</span>
  931. <span class="p">}</span>
  932. <span class="cp">?&gt;</span><span class="x"></span>
  933. </pre></div>
  934. </div>
  935. <p>Alternatively you can also use this way to integrate with OpenID as shown
  936. in <code class="file docutils literal"><span class="pre">examples/openid.php</span></code>:</p>
  937. <div class="highlight-php"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  938. <span class="cm">/* vim: set expandtab sw=4 ts=4 sts=4: */</span>
  939. <span class="sd">/**</span>
  940. <span class="sd"> * Single signon for phpMyAdmin using OpenID</span>
  941. <span class="sd"> *</span>
  942. <span class="sd"> * This is just example how to use single signon with phpMyAdmin, it is</span>
  943. <span class="sd"> * not intended to be perfect code and look, only shows how you can</span>
  944. <span class="sd"> * integrate this functionality in your application.</span>
  945. <span class="sd"> *</span>
  946. <span class="sd"> * It uses OpenID pear package, see https://pear.php.net/package/OpenID</span>
  947. <span class="sd"> *</span>
  948. <span class="sd"> * User first authenticates using OpenID and based on content of $AUTH_MAP</span>
  949. <span class="sd"> * the login information is passed to phpMyAdmin in session data.</span>
  950. <span class="sd"> *</span>
  951. <span class="sd"> * @package PhpMyAdmin</span>
  952. <span class="sd"> * @subpackage Example</span>
  953. <span class="sd"> */</span>
  954. <span class="k">if</span> <span class="p">(</span><span class="k">false</span> <span class="o">===</span> <span class="o">@</span><span class="k">include_once</span> <span class="s1">&#39;OpenID/RelyingParty.php&#39;</span><span class="p">)</span> <span class="p">{</span>
  955. <span class="k">exit</span><span class="p">;</span>
  956. <span class="p">}</span>
  957. <span class="cm">/* Change this to true if using phpMyAdmin over https */</span>
  958. <span class="nv">$secure_cookie</span> <span class="o">=</span> <span class="k">false</span><span class="p">;</span>
  959. <span class="sd">/**</span>
  960. <span class="sd"> * Map of authenticated users to MySQL user/password pairs.</span>
  961. <span class="sd"> */</span>
  962. <span class="nv">$AUTH_MAP</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span>
  963. <span class="s1">&#39;https://launchpad.net/~username&#39;</span> <span class="o">=&gt;</span> <span class="k">array</span><span class="p">(</span>
  964. <span class="s1">&#39;user&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;root&#39;</span><span class="p">,</span>
  965. <span class="s1">&#39;password&#39;</span> <span class="o">=&gt;</span> <span class="s1">&#39;&#39;</span><span class="p">,</span>
  966. <span class="p">),</span>
  967. <span class="p">);</span>
  968. <span class="sd">/**</span>
  969. <span class="sd"> * Simple function to show HTML page with given content.</span>
  970. <span class="sd"> *</span>
  971. <span class="sd"> * @param string $contents Content to include in page</span>
  972. <span class="sd"> *</span>
  973. <span class="sd"> * @return void</span>
  974. <span class="sd"> */</span>
  975. <span class="k">function</span> <span class="nf">Show_page</span><span class="p">(</span><span class="nv">$contents</span><span class="p">)</span>
  976. <span class="p">{</span>
  977. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Content-Type: text/html; charset=utf-8&#39;</span><span class="p">);</span>
  978. <span class="k">echo</span> <span class="s1">&#39;&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;&#39;</span> <span class="p">,</span> <span class="s2">&quot;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  979. <span class="cp">?&gt;</span><span class="x"></span>
  980. <span class="x"> &lt;!DOCTYPE HTML&gt;</span>
  981. <span class="x"> &lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;</span>
  982. <span class="x"> &lt;head&gt;</span>
  983. <span class="x"> &lt;link rel=&quot;icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</span>
  984. <span class="x"> &lt;link rel=&quot;shortcut icon&quot; href=&quot;../favicon.ico&quot; type=&quot;image/x-icon&quot; /&gt;</span>
  985. <span class="x"> &lt;meta charset=&quot;utf-8&quot; /&gt;</span>
  986. <span class="x"> &lt;title&gt;phpMyAdmin OpenID signon example&lt;/title&gt;</span>
  987. <span class="x"> &lt;/head&gt;</span>
  988. <span class="x"> &lt;body&gt;</span>
  989. <span class="x"> </span><span class="cp">&lt;?php</span>
  990. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_error_message&#39;</span><span class="p">]))</span> <span class="p">{</span>
  991. <span class="k">echo</span> <span class="s1">&#39;&lt;p class=&quot;error&quot;&gt;&#39;</span> <span class="p">,</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_message&#39;</span><span class="p">]</span> <span class="p">,</span> <span class="s1">&#39;&lt;/p&gt;&#39;</span><span class="p">;</span>
  992. <span class="nb">unset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_message&#39;</span><span class="p">]);</span>
  993. <span class="p">}</span>
  994. <span class="k">echo</span> <span class="nv">$contents</span><span class="p">;</span>
  995. <span class="cp">?&gt;</span><span class="x"></span>
  996. <span class="x"> &lt;/body&gt;</span>
  997. <span class="x"> &lt;/html&gt;</span>
  998. <span class="x"> </span><span class="cp">&lt;?php</span>
  999. <span class="p">}</span>
  1000. <span class="sd">/**</span>
  1001. <span class="sd"> * Display error and exit</span>
  1002. <span class="sd"> *</span>
  1003. <span class="sd"> * @param Exception $e Exception object</span>
  1004. <span class="sd"> *</span>
  1005. <span class="sd"> * @return void</span>
  1006. <span class="sd"> */</span>
  1007. <span class="k">function</span> <span class="nf">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">)</span>
  1008. <span class="p">{</span>
  1009. <span class="nv">$contents</span> <span class="o">=</span> <span class="s2">&quot;&lt;div class=&#39;relyingparty_results&#39;&gt;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1010. <span class="nv">$contents</span> <span class="o">.=</span> <span class="s2">&quot;&lt;pre&gt;&quot;</span> <span class="o">.</span> <span class="nb">htmlspecialchars</span><span class="p">(</span><span class="nv">$e</span><span class="o">-&gt;</span><span class="na">getMessage</span><span class="p">())</span> <span class="o">.</span> <span class="s2">&quot;&lt;/pre&gt;</span><span class="se">\n</span><span class="s2">&quot;</span><span class="p">;</span>
  1011. <span class="nv">$contents</span> <span class="o">.=</span> <span class="s2">&quot;&lt;/div class=&#39;relyingparty_results&#39;&gt;&quot;</span><span class="p">;</span>
  1012. <span class="nx">Show_page</span><span class="p">(</span><span class="nv">$contents</span><span class="p">);</span>
  1013. <span class="k">exit</span><span class="p">;</span>
  1014. <span class="p">}</span>
  1015. <span class="cm">/* Need to have cookie visible from parent directory */</span>
  1016. <span class="nb">session_set_cookie_params</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="s1">&#39;/&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$secure_cookie</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span>
  1017. <span class="cm">/* Create signon session */</span>
  1018. <span class="nv">$session_name</span> <span class="o">=</span> <span class="s1">&#39;SignonSession&#39;</span><span class="p">;</span>
  1019. <span class="nb">session_name</span><span class="p">(</span><span class="nv">$session_name</span><span class="p">);</span>
  1020. <span class="o">@</span><span class="nb">session_start</span><span class="p">();</span>
  1021. <span class="c1">// Determine realm and return_to</span>
  1022. <span class="nv">$base</span> <span class="o">=</span> <span class="s1">&#39;http&#39;</span><span class="p">;</span>
  1023. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTPS&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;HTTPS&#39;</span><span class="p">]</span> <span class="o">==</span> <span class="s1">&#39;on&#39;</span><span class="p">)</span> <span class="p">{</span>
  1024. <span class="nv">$base</span> <span class="o">.=</span> <span class="s1">&#39;s&#39;</span><span class="p">;</span>
  1025. <span class="p">}</span>
  1026. <span class="nv">$base</span> <span class="o">.=</span> <span class="s1">&#39;://&#39;</span> <span class="o">.</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;SERVER_NAME&#39;</span><span class="p">]</span> <span class="o">.</span> <span class="s1">&#39;:&#39;</span> <span class="o">.</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;SERVER_PORT&#39;</span><span class="p">];</span>
  1027. <span class="nv">$realm</span> <span class="o">=</span> <span class="nv">$base</span> <span class="o">.</span> <span class="s1">&#39;/&#39;</span><span class="p">;</span>
  1028. <span class="nv">$returnTo</span> <span class="o">=</span> <span class="nv">$base</span> <span class="o">.</span> <span class="nb">dirname</span><span class="p">(</span><span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;PHP_SELF&#39;</span><span class="p">]);</span>
  1029. <span class="k">if</span> <span class="p">(</span><span class="nv">$returnTo</span><span class="p">[</span><span class="nb">strlen</span><span class="p">(</span><span class="nv">$returnTo</span><span class="p">)</span> <span class="o">-</span> <span class="mi">1</span><span class="p">]</span> <span class="o">!=</span> <span class="s1">&#39;/&#39;</span><span class="p">)</span> <span class="p">{</span>
  1030. <span class="nv">$returnTo</span> <span class="o">.=</span> <span class="s1">&#39;/&#39;</span><span class="p">;</span>
  1031. <span class="p">}</span>
  1032. <span class="nv">$returnTo</span> <span class="o">.=</span> <span class="s1">&#39;openid.php&#39;</span><span class="p">;</span>
  1033. <span class="cm">/* Display form */</span>
  1034. <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nb">count</span><span class="p">(</span><span class="nv">$_GET</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="o">!</span><span class="nb">count</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">)</span> <span class="o">||</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$_GET</span><span class="p">[</span><span class="s1">&#39;phpMyAdmin&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1035. <span class="cm">/* Show simple form */</span>
  1036. <span class="nv">$content</span> <span class="o">=</span> <span class="s1">&#39;&lt;form action=&quot;openid.php&quot; method=&quot;post&quot;&gt;</span>
  1037. <span class="s1">OpenID: &lt;input type=&quot;text&quot; name=&quot;identifier&quot; /&gt;&lt;br /&gt;</span>
  1038. <span class="s1">&lt;input type=&quot;submit&quot; name=&quot;start&quot; /&gt;</span>
  1039. <span class="s1">&lt;/form&gt;</span>
  1040. <span class="s1">&lt;/body&gt;</span>
  1041. <span class="s1">&lt;/html&gt;&#39;</span><span class="p">;</span>
  1042. <span class="nx">Show_page</span><span class="p">(</span><span class="nv">$content</span><span class="p">);</span>
  1043. <span class="k">exit</span><span class="p">;</span>
  1044. <span class="p">}</span>
  1045. <span class="cm">/* Grab identifier */</span>
  1046. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nb">is_string</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1047. <span class="nv">$identifier</span> <span class="o">=</span> <span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">];</span>
  1048. <span class="p">}</span> <span class="k">elseif</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">])</span> <span class="o">&amp;&amp;</span> <span class="nb">is_string</span><span class="p">(</span><span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1049. <span class="nv">$identifier</span> <span class="o">=</span> <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;identifier&#39;</span><span class="p">];</span>
  1050. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1051. <span class="nv">$identifier</span> <span class="o">=</span> <span class="k">null</span><span class="p">;</span>
  1052. <span class="p">}</span>
  1053. <span class="cm">/* Create OpenID object */</span>
  1054. <span class="k">try</span> <span class="p">{</span>
  1055. <span class="nv">$o</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenID_RelyingParty</span><span class="p">(</span><span class="nv">$returnTo</span><span class="p">,</span> <span class="nv">$realm</span><span class="p">,</span> <span class="nv">$identifier</span><span class="p">);</span>
  1056. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Exception</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1057. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1058. <span class="p">}</span>
  1059. <span class="cm">/* Redirect to OpenID provider */</span>
  1060. <span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">[</span><span class="s1">&#39;start&#39;</span><span class="p">]))</span> <span class="p">{</span>
  1061. <span class="k">try</span> <span class="p">{</span>
  1062. <span class="nv">$authRequest</span> <span class="o">=</span> <span class="nv">$o</span><span class="o">-&gt;</span><span class="na">prepare</span><span class="p">();</span>
  1063. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Exception</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1064. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1065. <span class="p">}</span>
  1066. <span class="nv">$url</span> <span class="o">=</span> <span class="nv">$authRequest</span><span class="o">-&gt;</span><span class="na">getAuthorizeURL</span><span class="p">();</span>
  1067. <span class="nb">header</span><span class="p">(</span><span class="s2">&quot;Location: </span><span class="si">$url</span><span class="s2">&quot;</span><span class="p">);</span>
  1068. <span class="k">exit</span><span class="p">;</span>
  1069. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1070. <span class="cm">/* Grab query string */</span>
  1071. <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nb">count</span><span class="p">(</span><span class="nv">$_POST</span><span class="p">))</span> <span class="p">{</span>
  1072. <span class="k">list</span><span class="p">(,</span> <span class="nv">$queryString</span><span class="p">)</span> <span class="o">=</span> <span class="nb">explode</span><span class="p">(</span><span class="s1">&#39;?&#39;</span><span class="p">,</span> <span class="nv">$_SERVER</span><span class="p">[</span><span class="s1">&#39;REQUEST_URI&#39;</span><span class="p">]);</span>
  1073. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1074. <span class="c1">// I hate php sometimes</span>
  1075. <span class="nv">$queryString</span> <span class="o">=</span> <span class="nb">file_get_contents</span><span class="p">(</span><span class="s1">&#39;php://input&#39;</span><span class="p">);</span>
  1076. <span class="p">}</span>
  1077. <span class="cm">/* Check reply */</span>
  1078. <span class="k">try</span> <span class="p">{</span>
  1079. <span class="nv">$message</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">OpenID_Message</span><span class="p">(</span><span class="nv">$queryString</span><span class="p">,</span> <span class="nx">OpenID_Message</span><span class="o">::</span><span class="na">FORMAT_HTTP</span><span class="p">);</span>
  1080. <span class="p">}</span> <span class="k">catch</span> <span class="p">(</span><span class="nx">Exception</span> <span class="nv">$e</span><span class="p">)</span> <span class="p">{</span>
  1081. <span class="nx">Die_error</span><span class="p">(</span><span class="nv">$e</span><span class="p">);</span>
  1082. <span class="p">}</span>
  1083. <span class="nv">$id</span> <span class="o">=</span> <span class="nv">$message</span><span class="o">-&gt;</span><span class="na">get</span><span class="p">(</span><span class="s1">&#39;openid.claimed_id&#39;</span><span class="p">);</span>
  1084. <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">empty</span><span class="p">(</span><span class="nv">$id</span><span class="p">)</span> <span class="o">&amp;&amp;</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">]))</span> <span class="p">{</span>
  1085. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_user&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">][</span><span class="s1">&#39;user&#39;</span><span class="p">];</span>
  1086. <span class="nv">$_SESSION</span><span class="p">[</span><span class="s1">&#39;PMA_single_signon_password&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nv">$AUTH_MAP</span><span class="p">[</span><span class="nv">$id</span><span class="p">][</span><span class="s1">&#39;password&#39;</span><span class="p">];</span>
  1087. <span class="nb">session_write_close</span><span class="p">();</span>
  1088. <span class="cm">/* Redirect to phpMyAdmin (should use absolute URL here!) */</span>
  1089. <span class="nb">header</span><span class="p">(</span><span class="s1">&#39;Location: ../index.php&#39;</span><span class="p">);</span>
  1090. <span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
  1091. <span class="nx">Show_page</span><span class="p">(</span><span class="s1">&#39;&lt;p&gt;User not allowed!&lt;/p&gt;&#39;</span><span class="p">);</span>
  1092. <span class="k">exit</span><span class="p">;</span>
  1093. <span class="p">}</span>
  1094. <span class="p">}</span>
  1095. </pre></div>
  1096. </div>
  1097. <p>If you intend to pass the credentials using some other means than, you have to
  1098. implement wrapper in PHP to get that data and set it to
  1099. <span class="target" id="index-26"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>. There is very minimal example
  1100. in <code class="file docutils literal"><span class="pre">examples/signon-script.php</span></code>:</p>
  1101. <div class="highlight-php"><div class="highlight"><pre><span></span><span class="o">&lt;?</span><span class="nx">php</span>
  1102. <span class="cm">/* vim: set expandtab sw=4 ts=4 sts=4: */</span>
  1103. <span class="sd">/**</span>
  1104. <span class="sd"> * Single signon for phpMyAdmin</span>
  1105. <span class="sd"> *</span>
  1106. <span class="sd"> * This is just example how to use script based single signon with</span>
  1107. <span class="sd"> * phpMyAdmin, it is not intended to be perfect code and look, only</span>
  1108. <span class="sd"> * shows how you can integrate this functionality in your application.</span>
  1109. <span class="sd"> *</span>
  1110. <span class="sd"> * @package PhpMyAdmin</span>
  1111. <span class="sd"> * @subpackage Example</span>
  1112. <span class="sd"> */</span>
  1113. <span class="sd">/**</span>
  1114. <span class="sd"> * This function returns username and password.</span>
  1115. <span class="sd"> *</span>
  1116. <span class="sd"> * It can optionally use configured username as parameter.</span>
  1117. <span class="sd"> *</span>
  1118. <span class="sd"> * @param string $user User name</span>
  1119. <span class="sd"> *</span>
  1120. <span class="sd"> * @return array</span>
  1121. <span class="sd"> */</span>
  1122. <span class="k">function</span> <span class="nf">get_login_credentials</span><span class="p">(</span><span class="nv">$user</span><span class="p">)</span>
  1123. <span class="p">{</span>
  1124. <span class="cm">/* Optionally we can use passed username */</span>
  1125. <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="k">empty</span><span class="p">(</span><span class="nv">$user</span><span class="p">))</span> <span class="p">{</span>
  1126. <span class="k">return</span> <span class="k">array</span><span class="p">(</span><span class="nv">$user</span><span class="p">,</span> <span class="s1">&#39;password&#39;</span><span class="p">);</span>
  1127. <span class="p">}</span>
  1128. <span class="cm">/* Here we would retrieve the credentials */</span>
  1129. <span class="nv">$credentials</span> <span class="o">=</span> <span class="k">array</span><span class="p">(</span><span class="s1">&#39;root&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">);</span>
  1130. <span class="k">return</span> <span class="nv">$credentials</span><span class="p">;</span>
  1131. <span class="p">}</span>
  1132. </pre></div>
  1133. </div>
  1134. <div class="admonition seealso">
  1135. <p class="first admonition-title">See also</p>
  1136. <p class="last"><span class="target" id="index-27"></span><a class="reference internal" href="config.html#cfg_Servers_auth_type"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['auth_type']</span></code></a>,
  1137. <span class="target" id="index-28"></span><a class="reference internal" href="config.html#cfg_Servers_SignonSession"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonSession']</span></code></a>,
  1138. <span class="target" id="index-29"></span><a class="reference internal" href="config.html#cfg_Servers_SignonCookieParams"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonCookieParams']</span></code></a>,
  1139. <span class="target" id="index-30"></span><a class="reference internal" href="config.html#cfg_Servers_SignonScript"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonScript']</span></code></a>,
  1140. <span class="target" id="index-31"></span><a class="reference internal" href="config.html#cfg_Servers_SignonURL"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['SignonURL']</span></code></a>,
  1141. <a class="reference internal" href="config.html#example-signon"><span class="std std-ref">Example for signon authentication</span></a></p>
  1142. </div>
  1143. </div>
  1144. <div class="section" id="config-authentication-mode">
  1145. <span id="auth-config"></span><span id="index-32"></span><h3>Config authentication mode<a class="headerlink" href="#config-authentication-mode" title="Permalink to this headline">¶</a></h3>
  1146. <ul class="simple">
  1147. <li>This mode is sometimes the less secure one because it requires you to fill the
  1148. <span class="target" id="index-33"></span><a class="reference internal" href="config.html#cfg_Servers_user"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['user']</span></code></a> and
  1149. <span class="target" id="index-34"></span><a class="reference internal" href="config.html#cfg_Servers_password"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['password']</span></code></a>
  1150. fields (and as a result, anyone who can read your <code class="file docutils literal"><span class="pre">config.inc.php</span></code>
  1151. can discover your username and password).</li>
  1152. <li>In the <a class="reference internal" href="faq.html#faqmultiuser"><span class="std std-ref">ISPs, multi-user installations</span></a> section, there is an entry explaining how
  1153. to protect your configuration file.</li>
  1154. <li>For additional security in this mode, you may wish to consider the
  1155. Host authentication <span class="target" id="index-35"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_order"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['order']</span></code></a>
  1156. and <span class="target" id="index-36"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></code></a> configuration directives.</li>
  1157. <li>Unlike cookie and http, does not require a user to log in when first
  1158. loading the phpMyAdmin site. This is by design but could allow any
  1159. user to access your installation. Use of some restriction method is
  1160. suggested, perhaps a <a class="reference internal" href="glossary.html#term-htaccess"><span class="xref std std-term">.htaccess</span></a> file with the HTTP-AUTH directive or disallowing
  1161. incoming HTTP requests at one’s router or firewall will suffice (both
  1162. of which are beyond the scope of this manual but easily searchable
  1163. with Google).</li>
  1164. </ul>
  1165. </div>
  1166. </div>
  1167. <div class="section" id="securing-your-phpmyadmin-installation">
  1168. <span id="securing"></span><h2>Securing your phpMyAdmin installation<a class="headerlink" href="#securing-your-phpmyadmin-installation" title="Permalink to this headline">¶</a></h2>
  1169. <p>The phpMyAdmin team tries hard to make the application secure, however there
  1170. are always ways to make your installation more secure:</p>
  1171. <ul>
  1172. <li><p class="first">Follow our <a class="reference external" href="https://www.phpmyadmin.net/security/">Security announcements</a> and upgrade
  1173. phpMyAdmin whenever new vulnerability is published.</p>
  1174. </li>
  1175. <li><p class="first">Serve phpMyAdmin on HTTPS only. Preferably, you should use HSTS as well, so that
  1176. you&#8217;re protected from protocol downgrade attacks.</p>
  1177. </li>
  1178. <li><p class="first">Ensure your PHP setup follows recommendations for production sites, for example
  1179. <a class="reference external" href="https://secure.php.net/manual/en/errorfunc.configuration.php#ini.display-errors">display_errors</a>
  1180. should be disabled.</p>
  1181. </li>
  1182. <li><p class="first">Remove the <code class="docutils literal"><span class="pre">test</span></code> directory from phpMyAdmin, unless you are developing and need test suite.</p>
  1183. </li>
  1184. <li><p class="first">Remove the <code class="docutils literal"><span class="pre">setup</span></code> directory from phpMyAdmin, you will probably not
  1185. use it after the initial setup.</p>
  1186. </li>
  1187. <li><p class="first">Properly choose an authentication method - <a class="reference internal" href="#cookie"><span class="std std-ref">Cookie authentication mode</span></a>
  1188. is probably the best choice for shared hosting.</p>
  1189. </li>
  1190. <li><p class="first">Deny access to auxiliary files in <code class="file docutils literal"><span class="pre">./libraries/</span></code> or
  1191. <code class="file docutils literal"><span class="pre">./templates/</span></code> subfolders in your webserver configuration.
  1192. Such configuration prevents from possible path exposure and cross side
  1193. scripting vulnerabilities that might happen to be found in that code. For the
  1194. Apache webserver, this is often accomplished with a <a class="reference internal" href="glossary.html#term-htaccess"><span class="xref std std-term">.htaccess</span></a> file in
  1195. those directories.</p>
  1196. </li>
  1197. <li><p class="first">Deny access to temporary files, see <span class="target" id="index-37"></span><a class="reference internal" href="config.html#cfg_TempDir"><code class="xref config config-option docutils literal"><span class="pre">$cfg['TempDir']</span></code></a> (if that
  1198. is placed inside your web root, see also <a class="reference internal" href="config.html#web-dirs"><span class="std std-ref">Web server upload/save/import directories</span></a>.</p>
  1199. </li>
  1200. <li><p class="first">It is generally a good idea to protect a public phpMyAdmin installation
  1201. against access by robots as they usually can not do anything good there. You
  1202. can do this using <code class="docutils literal"><span class="pre">robots.txt</span></code> file in root of your webserver or limit
  1203. access by web server configuration, see <a class="reference internal" href="faq.html#faq1-42"><span class="std std-ref">1.42 How can I prevent robots from accessing phpMyAdmin?</span></a>.</p>
  1204. </li>
  1205. <li><p class="first">In case you don&#8217;t want all MySQL users to be able to access
  1206. phpMyAdmin, you can use <span class="target" id="index-38"></span><a class="reference internal" href="config.html#cfg_Servers_AllowDeny_rules"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowDeny']['rules']</span></code></a> to limit them
  1207. or <span class="target" id="index-39"></span><a class="reference internal" href="config.html#cfg_Servers_AllowRoot"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['AllowRoot']</span></code></a> to deny root user access.</p>
  1208. </li>
  1209. <li><p class="first">Enable <a class="reference internal" href="two_factor.html#fa"><span class="std std-ref">Two-factor authentication</span></a> for your account.</p>
  1210. </li>
  1211. <li><p class="first">Consider hiding phpMyAdmin behind an authentication proxy, so that
  1212. users need to authenticate prior to providing MySQL credentials
  1213. to phpMyAdmin. You can achieve this by configuring your web server to request
  1214. HTTP authentication. For example in Apache this can be done with:</p>
  1215. <div class="highlight-apache"><div class="highlight"><pre><span></span><span class="nb">AuthType</span> Basic
  1216. <span class="nb">AuthName</span> <span class="s2">&quot;Restricted Access&quot;</span>
  1217. <span class="nb">AuthUserFile</span> <span class="sx">/usr/share/phpmyadmin/passwd</span>
  1218. <span class="nb">Require</span> valid-user
  1219. </pre></div>
  1220. </div>
  1221. <p>Once you have changed the configuration, you need to create a list of users which
  1222. can authenticate. This can be done using the <strong class="program">htpasswd</strong> utility:</p>
  1223. <div class="highlight-sh"><div class="highlight"><pre><span></span>htpasswd -c /usr/share/phpmyadmin/passwd username
  1224. </pre></div>
  1225. </div>
  1226. </li>
  1227. <li><p class="first">If you are afraid of automated attacks, enabling Captcha by
  1228. <span class="target" id="index-40"></span><a class="reference internal" href="config.html#cfg_CaptchaLoginPublicKey"><code class="xref config config-option docutils literal"><span class="pre">$cfg['CaptchaLoginPublicKey']</span></code></a> and
  1229. <span class="target" id="index-41"></span><a class="reference internal" href="config.html#cfg_CaptchaLoginPrivateKey"><code class="xref config config-option docutils literal"><span class="pre">$cfg['CaptchaLoginPrivateKey']</span></code></a> might be an option.</p>
  1230. </li>
  1231. <li><p class="first">Failed login attemps are logged to syslog (if available, see
  1232. <span class="target" id="index-42"></span><a class="reference internal" href="config.html#cfg_AuthLog"><code class="xref config config-option docutils literal"><span class="pre">$cfg['AuthLog']</span></code></a>). This can allow using a tool such as
  1233. fail2ban to block brute-force attempts. Note that the log file used by syslog
  1234. is not the same as the Apache error or access log files.</p>
  1235. </li>
  1236. <li><p class="first">In case you&#8217;re running phpMyAdmin together with other PHP applications, it is
  1237. generally advised to use separate session storage for phpMyAdmin to avoid
  1238. possible session based attacks against it. You can use
  1239. <span class="target" id="index-43"></span><a class="reference internal" href="config.html#cfg_SessionSavePath"><code class="xref config config-option docutils literal"><span class="pre">$cfg['SessionSavePath']</span></code></a> to achieve this.</p>
  1240. </li>
  1241. </ul>
  1242. </div>
  1243. <div class="section" id="using-ssl-for-connection-to-database-server">
  1244. <span id="ssl"></span><h2>Using SSL for connection to database server<a class="headerlink" href="#using-ssl-for-connection-to-database-server" title="Permalink to this headline">¶</a></h2>
  1245. <p>It is recommended to use SSL when connecting to remote database server. There
  1246. are several configuration options involved in the SSL setup:</p>
  1247. <dl class="docutils">
  1248. <dt><span class="target" id="index-44"></span><a class="reference internal" href="config.html#cfg_Servers_ssl"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl']</span></code></a></dt>
  1249. <dd>Defines whether to use SSL at all. If you enable only this, the connection
  1250. will be encrypted, but there is not authentication of the connection - you
  1251. can not verify that you are talking to the right server.</dd>
  1252. <dt><span class="target" id="index-45"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a> and <span class="target" id="index-46"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a></dt>
  1253. <dd>This is used for authentication of client to the server.</dd>
  1254. <dt><span class="target" id="index-47"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a> and <span class="target" id="index-48"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca_path"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_ca_path']</span></code></a></dt>
  1255. <dd>The certificate authorities you trust for server certificates.
  1256. This is used to ensure that you are talking to a trusted server.</dd>
  1257. <dt><span class="target" id="index-49"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></dt>
  1258. <dd>This configuration disables server certificate verification. Use with
  1259. caution.</dd>
  1260. </dl>
  1261. <div class="admonition seealso">
  1262. <p class="first admonition-title">See also</p>
  1263. <p class="last"><a class="reference internal" href="config.html#example-google-ssl"><span class="std std-ref">Google Cloud SQL with SSL</span></a>,
  1264. <span class="target" id="index-50"></span><a class="reference internal" href="config.html#cfg_Servers_ssl"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl']</span></code></a>,
  1265. <span class="target" id="index-51"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_key"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_key']</span></code></a>,
  1266. <span class="target" id="index-52"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_cert"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_cert']</span></code></a>,
  1267. <span class="target" id="index-53"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_ca']</span></code></a>,
  1268. <span class="target" id="index-54"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ca_path"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_ca_path']</span></code></a>,
  1269. <span class="target" id="index-55"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_ciphers"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_ciphers']</span></code></a>,
  1270. <span class="target" id="index-56"></span><a class="reference internal" href="config.html#cfg_Servers_ssl_verify"><code class="xref config config-option docutils literal"><span class="pre">$cfg['Servers'][$i]['ssl_verify']</span></code></a></p>
  1271. </div>
  1272. </div>
  1273. <div class="section" id="known-issues">
  1274. <h2>Known issues<a class="headerlink" href="#known-issues" title="Permalink to this headline">¶</a></h2>
  1275. <div class="section" id="users-with-column-specific-privileges-are-unable-to-browse">
  1276. <h3>Users with column-specific privileges are unable to &#8220;Browse&#8221;<a class="headerlink" href="#users-with-column-specific-privileges-are-unable-to-browse" title="Permalink to this headline">¶</a></h3>
  1277. <p>If a user has only column-specific privileges on some (but not all) columns in a table, &#8220;Browse&#8221;
  1278. will fail with an error message.</p>
  1279. <p>As a workaround, a bookmarked query with the same name as the table can be created, this will
  1280. run when using the &#8220;Browse&#8221; link instead. <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/issues/11922">Issue 11922</a>.</p>
  1281. </div>
  1282. <div class="section" id="trouble-logging-back-in-after-logging-out-using-http-authentication">
  1283. <h3>Trouble logging back in after logging out using &#8216;http&#8217; authentication<a class="headerlink" href="#trouble-logging-back-in-after-logging-out-using-http-authentication" title="Permalink to this headline">¶</a></h3>
  1284. <p>When using the &#8216;http&#8217; <code class="docutils literal"><span class="pre">auth_type</span></code>, it can be impossible to log back in (when the logout comes
  1285. manually or after a period of inactivity). <a class="reference external" href="https://github.com/phpmyadmin/phpmyadmin/issues/11898">Issue 11898</a>.</p>
  1286. </div>
  1287. </div>
  1288. </div>
  1289. </div>
  1290. </div>
  1291. </div>
  1292. <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
  1293. <div class="sphinxsidebarwrapper">
  1294. <h3><a href="index.html">Table Of Contents</a></h3>
  1295. <ul>
  1296. <li><a class="reference internal" href="#">Installation</a><ul>
  1297. <li><a class="reference internal" href="#linux-distributions">Linux distributions</a><ul>
  1298. <li><a class="reference internal" href="#debian">Debian</a></li>
  1299. <li><a class="reference internal" href="#opensuse">OpenSUSE</a></li>
  1300. <li><a class="reference internal" href="#ubuntu">Ubuntu</a></li>
  1301. <li><a class="reference internal" href="#gentoo">Gentoo</a></li>
  1302. <li><a class="reference internal" href="#mandriva">Mandriva</a></li>
  1303. <li><a class="reference internal" href="#fedora">Fedora</a></li>
  1304. <li><a class="reference internal" href="#red-hat-enterprise-linux">Red Hat Enterprise Linux</a></li>
  1305. </ul>
  1306. </li>
  1307. <li><a class="reference internal" href="#installing-on-windows">Installing on Windows</a></li>
  1308. <li><a class="reference internal" href="#installing-from-git">Installing from Git</a></li>
  1309. <li><a class="reference internal" href="#installing-using-composer">Installing using Composer</a></li>
  1310. <li><a class="reference internal" href="#installing-using-docker">Installing using Docker</a><ul>
  1311. <li><a class="reference internal" href="#docker-environment-variables">Docker environment variables</a></li>
  1312. <li><a class="reference internal" href="#customizing-configuration">Customizing configuration</a></li>
  1313. <li><a class="reference internal" href="#docker-volumes">Docker Volumes</a></li>
  1314. <li><a class="reference internal" href="#docker-examples">Docker Examples</a></li>
  1315. <li><a class="reference internal" href="#using-docker-compose">Using docker-compose</a></li>
  1316. <li><a class="reference internal" href="#customizing-configuration-file-using-docker-compose">Customizing configuration file using docker-compose</a></li>
  1317. <li><a class="reference internal" href="#running-behind-haproxy-in-a-subdirectory">Running behind haproxy in a subdirectory</a></li>
  1318. </ul>
  1319. </li>
  1320. <li><a class="reference internal" href="#quick-install">Quick Install</a><ul>
  1321. <li><a class="reference internal" href="#manually-creating-the-file">Manually creating the file</a></li>
  1322. <li><a class="reference internal" href="#using-setup-script">Using Setup script</a><ul>
  1323. <li><a class="reference internal" href="#setup-script-on-debian-ubuntu-and-derivatives">Setup script on Debian, Ubuntu and derivatives</a></li>
  1324. <li><a class="reference internal" href="#setup-script-on-opensuse">Setup script on openSUSE</a></li>
  1325. </ul>
  1326. </li>
  1327. </ul>
  1328. </li>
  1329. <li><a class="reference internal" href="#verifying-phpmyadmin-releases">Verifying phpMyAdmin releases</a></li>
  1330. <li><a class="reference internal" href="#phpmyadmin-configuration-storage">phpMyAdmin configuration storage</a><ul>
  1331. <li><a class="reference internal" href="#zero-configuration">Zero configuration</a></li>
  1332. <li><a class="reference internal" href="#manual-configuration">Manual configuration</a></li>
  1333. </ul>
  1334. </li>
  1335. <li><a class="reference internal" href="#upgrading-from-an-older-version">Upgrading from an older version</a></li>
  1336. <li><a class="reference internal" href="#using-authentication-modes">Using authentication modes</a><ul>
  1337. <li><a class="reference internal" href="#http-authentication-mode">HTTP authentication mode</a></li>
  1338. <li><a class="reference internal" href="#cookie-authentication-mode">Cookie authentication mode</a></li>
  1339. <li><a class="reference internal" href="#signon-authentication-mode">Signon authentication mode</a></li>
  1340. <li><a class="reference internal" href="#config-authentication-mode">Config authentication mode</a></li>
  1341. </ul>
  1342. </li>
  1343. <li><a class="reference internal" href="#securing-your-phpmyadmin-installation">Securing your phpMyAdmin installation</a></li>
  1344. <li><a class="reference internal" href="#using-ssl-for-connection-to-database-server">Using SSL for connection to database server</a></li>
  1345. <li><a class="reference internal" href="#known-issues">Known issues</a><ul>
  1346. <li><a class="reference internal" href="#users-with-column-specific-privileges-are-unable-to-browse">Users with column-specific privileges are unable to &#8220;Browse&#8221;</a></li>
  1347. <li><a class="reference internal" href="#trouble-logging-back-in-after-logging-out-using-http-authentication">Trouble logging back in after logging out using &#8216;http&#8217; authentication</a></li>
  1348. </ul>
  1349. </li>
  1350. </ul>
  1351. </li>
  1352. </ul>
  1353. <h4>Previous topic</h4>
  1354. <p class="topless"><a href="require.html"
  1355. title="previous chapter">Requirements</a></p>
  1356. <h4>Next topic</h4>
  1357. <p class="topless"><a href="config.html"
  1358. title="next chapter">Configuration</a></p>
  1359. <div role="note" aria-label="source link">
  1360. <h3>This Page</h3>
  1361. <ul class="this-page-menu">
  1362. <li><a href="_sources/setup.txt"
  1363. rel="nofollow">Show Source</a></li>
  1364. </ul>
  1365. </div>
  1366. <div id="searchbox" style="display: none" role="search">
  1367. <h3>Quick search</h3>
  1368. <form class="search" action="search.html" method="get">
  1369. <div><input type="text" name="q" /></div>
  1370. <div><input type="submit" value="Go" /></div>
  1371. <input type="hidden" name="check_keywords" value="yes" />
  1372. <input type="hidden" name="area" value="default" />
  1373. </form>
  1374. </div>
  1375. <script type="text/javascript">$('#searchbox').show(0);</script>
  1376. </div>
  1377. </div>
  1378. <div class="clearer"></div>
  1379. </div>
  1380. <div class="related" role="navigation" aria-label="related navigation">
  1381. <h3>Navigation</h3>
  1382. <ul>
  1383. <li class="right" style="margin-right: 10px">
  1384. <a href="genindex.html" title="General Index"
  1385. >index</a></li>
  1386. <li class="right" >
  1387. <a href="config.html" title="Configuration"
  1388. >next</a> |</li>
  1389. <li class="right" >
  1390. <a href="require.html" title="Requirements"
  1391. >previous</a> |</li>
  1392. <li class="nav-item nav-item-0"><a href="index.html">phpMyAdmin 4.8.5 documentation</a> &#187;</li>
  1393. </ul>
  1394. </div>
  1395. <div class="footer" role="contentinfo">
  1396. &#169; <a href="copyright.html">Copyright</a> 2012 - 2018, The phpMyAdmin devel team.
  1397. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
  1398. </div>
  1399. </body>
  1400. </html>