config.inc.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. if (!function_exists('check_file_access')) {
  20. function check_file_access($path)
  21. {
  22. if (is_readable($path)) {
  23. return true;
  24. } else {
  25. error_log(
  26. 'phpmyadmin: Failed to load ' . $path
  27. . ' Check group www-data has read access and open_basedir restrictions.'
  28. );
  29. return false;
  30. }
  31. }
  32. }
  33. // Load secret generated on postinst
  34. if (check_file_access('/var/lib/phpmyadmin/blowfish_secret.inc.php')) {
  35. require('/var/lib/phpmyadmin/blowfish_secret.inc.php');
  36. }
  37. // Load autoconf local config
  38. if (check_file_access('/var/lib/phpmyadmin/config.inc.php')) {
  39. require('/var/lib/phpmyadmin/config.inc.php');
  40. }
  41. /**
  42. * Server(s) configuration
  43. */
  44. $i = 0;
  45. // The $cfg['Servers'] array starts with $cfg['Servers'][1]. Do not use $cfg['Servers'][0].
  46. // You can disable a server config entry by setting host to ''.
  47. $i++;
  48. /**
  49. * Read configuration from dbconfig-common
  50. * You can regenerate it using: dpkg-reconfigure -plow phpmyadmin
  51. */
  52. if (check_file_access('/etc/phpmyadmin/config-db.php')) {
  53. require('/etc/phpmyadmin/config-db.php');
  54. }
  55. /* Configure according to dbconfig-common if enabled */
  56. if (!empty($dbname)) {
  57. /* Authentication type */
  58. $cfg['Servers'][$i]['auth_type'] = 'cookie';
  59. /* Server parameters */
  60. if (empty($dbserver)) $dbserver = 'localhost';
  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. /*
  129. * Temp dir for faster beahivour
  130. *
  131. */
  132. $cfg['TempDir'] = '/tmp';
  133. /* Support additional configurations */
  134. foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
  135. {
  136. include($filename);
  137. }