config.inc.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. <?php
  2. /**
  3. * Debian local configuration file
  4. *
  5. * This file overrides the settings made by phpMyAdmin interactive setup
  6. * utility.
  7. *
  8. * For example configuration see
  9. * /usr/share/doc/phpmyadmin/examples/config.sample.inc.php
  10. * or
  11. * /usr/share/doc/phpmyadmin/examples/config.manyhosts.inc.php
  12. *
  13. * NOTE: do not add security sensitive data to this file (like passwords)
  14. * unless you really know what you're doing. If you do, any user that can
  15. * run PHP or CGI on your webserver will be able to read them. If you still
  16. * want to do this, make sure to properly secure the access to this file
  17. * (also on the filesystem level).
  18. */
  19. function check_file_access($path) {
  20. if (is_readable($path)) {
  21. return true;
  22. } else {
  23. error_log(
  24. "phpmyadmin: Failed to load " .
  25. $path .
  26. " Check group apache has read access and open_basedir restrictions.",
  27. );
  28. return false;
  29. }
  30. }
  31. // Load secret generated on postinst
  32. if (check_file_access("/var/lib/phpmyadmin/blowfish_secret.inc.php")) {
  33. require "/var/lib/phpmyadmin/blowfish_secret.inc.php";
  34. }
  35. // Load autoconf local config
  36. if (check_file_access("/var/lib/phpmyadmin/config.inc.php")) {
  37. require "/var/lib/phpmyadmin/config.inc.php";
  38. }
  39. /**
  40. * Server(s) configuration
  41. */
  42. $i = 0;
  43. // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
  44. // You can disable a server config entry by setting host to ''.
  45. $i++;
  46. /**
  47. * Read configuration from dbconfig-common
  48. * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
  49. */
  50. if (check_file_access("/etc/phpmyadmin/config-db.php")) {
  51. require "/etc/phpmyadmin/config-db.php";
  52. }
  53. /* Configure according to dbconfig-common if enabled */
  54. if (!empty($dbname)) {
  55. /* Authentication type */
  56. $cfg["Servers"][$i]["auth_type"] = "cookie";
  57. /* Server parameters */
  58. if (empty($dbserver)) {
  59. $dbserver = "localhost";
  60. }
  61. $cfg["Servers"][$i]["host"] = $dbserver;
  62. if (!empty($dbport) || $dbserver != "localhost") {
  63. $cfg["Servers"][$i]["connect_type"] = "tcp";
  64. $cfg["Servers"][$i]["port"] = $dbport;
  65. }
  66. //$cfg['Servers'][$i]['compress'] = false;
  67. /* Select mysqli if your server has it */
  68. $cfg["Servers"][$i]["extension"] = "mysqli";
  69. /* Optional: User for advanced features */
  70. $cfg["Servers"][$i]["controluser"] = $dbuser;
  71. $cfg["Servers"][$i]["controlpass"] = $dbpass;
  72. /* Optional: Advanced phpMyAdmin features */
  73. $cfg["Servers"][$i]["pmadb"] = $dbname;
  74. $cfg["Servers"][$i]["bookmarktable"] = "pma_bookmark";
  75. $cfg["Servers"][$i]["relation"] = "pma_relation";
  76. $cfg["Servers"][$i]["table_info"] = "pma_table_info";
  77. $cfg["Servers"][$i]["table_coords"] = "pma_table_coords";
  78. $cfg["Servers"][$i]["pdf_pages"] = "pma_pdf_pages";
  79. $cfg["Servers"][$i]["column_info"] = "pma_column_info";
  80. $cfg["Servers"][$i]["history"] = "pma_history";
  81. $cfg["Servers"][$i]["table_uiprefs"] = "pma_table_uiprefs";
  82. $cfg["Servers"][$i]["designer_coords"] = "pma_designer_coords";
  83. $cfg["Servers"][$i]["tracking"] = "pma_tracking";
  84. $cfg["Servers"][$i]["userconfig"] = "pma_userconfig";
  85. $cfg["Servers"][$i]["recent"] = "pma_recent";
  86. /* Uncomment the following to enable logging in to passwordless accounts,
  87. * after taking note of the associated security risks. */
  88. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  89. /* Advance to next server for rest of config */
  90. $i++;
  91. }
  92. /* Authentication type */
  93. //$cfg['Servers'][$i]['auth_type'] = 'cookie';
  94. /* Server parameters */
  95. //$cfg['Servers'][$i]['host'] = 'localhost';
  96. //$cfg['Servers'][$i]['connect_type'] = 'tcp';
  97. //$cfg['Servers'][$i]['compress'] = false;
  98. /* Select mysqli if your server has it */
  99. //$cfg['Servers'][$i]['extension'] = 'mysql';
  100. /* Optional: User for advanced features */
  101. // $cfg['Servers'][$i]['controluser'] = 'pma';
  102. // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
  103. /* Storage database and tables */
  104. // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
  105. // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
  106. // $cfg['Servers'][$i]['relation'] = 'pma_relation';
  107. // $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
  108. // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
  109. // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
  110. // $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
  111. // $cfg['Servers'][$i]['history'] = 'pma_history';
  112. // $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
  113. // $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
  114. // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
  115. // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
  116. // $cfg['Servers'][$i]['recent'] = 'pma_recent';
  117. /* Uncomment the following to enable logging in to passwordless accounts,
  118. * after taking note of the associated security risks. */
  119. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  120. /*
  121. * End of servers configuration
  122. */
  123. /*
  124. * Directories for saving/loading files from server
  125. */
  126. $cfg["UploadDir"] = "";
  127. $cfg["SaveDir"] = "";
  128. /* Support additional configurations */
  129. foreach (glob("/etc/phpmyadmin/conf.d/*.php") as $filename) {
  130. include $filename;
  131. }