config.inc.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. {
  21. if (is_readable($path)) {
  22. return true;
  23. } else {
  24. error_log(
  25. 'phpmyadmin: Failed to load ' . $path
  26. . ' Check group www-data 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)) $dbserver = 'localhost';
  59. $cfg['Servers'][$i]['host'] = $dbserver;
  60. if (!empty($dbport) || $dbserver != 'localhost') {
  61. $cfg['Servers'][$i]['connect_type'] = 'tcp';
  62. $cfg['Servers'][$i]['port'] = $dbport;
  63. }
  64. //$cfg['Servers'][$i]['compress'] = false;
  65. /* Select mysqli if your server has it */
  66. $cfg['Servers'][$i]['extension'] = 'mysqli';
  67. /* Optional: User for advanced features */
  68. $cfg['Servers'][$i]['controluser'] = $dbuser;
  69. $cfg['Servers'][$i]['controlpass'] = $dbpass;
  70. /* Optional: Advanced phpMyAdmin features */
  71. $cfg['Servers'][$i]['pmadb'] = $dbname;
  72. $cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
  73. $cfg['Servers'][$i]['relation'] = 'pma__relation';
  74. $cfg['Servers'][$i]['table_info'] = 'pma__table_info';
  75. $cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
  76. $cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
  77. $cfg['Servers'][$i]['column_info'] = 'pma__column_info';
  78. $cfg['Servers'][$i]['history'] = 'pma__history';
  79. $cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
  80. $cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
  81. $cfg['Servers'][$i]['tracking'] = 'pma__tracking';
  82. $cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
  83. $cfg['Servers'][$i]['recent'] = 'pma__recent';
  84. /* Uncomment the following to enable logging in to passwordless accounts,
  85. * after taking note of the associated security risks. */
  86. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  87. /* Advance to next server for rest of config */
  88. $i++;
  89. }
  90. /* Authentication type */
  91. //$cfg['Servers'][$i]['auth_type'] = 'cookie';
  92. /* Server parameters */
  93. //$cfg['Servers'][$i]['host'] = 'localhost';
  94. //$cfg['Servers'][$i]['connect_type'] = 'tcp';
  95. //$cfg['Servers'][$i]['compress'] = false;
  96. /* Select mysqli if your server has it */
  97. //$cfg['Servers'][$i]['extension'] = 'mysql';
  98. /* Optional: User for advanced features */
  99. // $cfg['Servers'][$i]['controluser'] = 'pma';
  100. // $cfg['Servers'][$i]['controlpass'] = 'pmapass';
  101. /* Storage database and tables */
  102. // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
  103. // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
  104. // $cfg['Servers'][$i]['relation'] = 'pma_relation';
  105. // $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
  106. // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
  107. // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
  108. // $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
  109. // $cfg['Servers'][$i]['history'] = 'pma_history';
  110. // $cfg['Servers'][$i]['table_uiprefs'] = 'pma_table_uiprefs';
  111. // $cfg['Servers'][$i]['tracking'] = 'pma_tracking';
  112. // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords';
  113. // $cfg['Servers'][$i]['userconfig'] = 'pma_userconfig';
  114. // $cfg['Servers'][$i]['recent'] = 'pma_recent';
  115. /* Uncomment the following to enable logging in to passwordless accounts,
  116. * after taking note of the associated security risks. */
  117. // $cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
  118. /*
  119. * End of servers configuration
  120. */
  121. /*
  122. * Directories for saving/loading files from server
  123. */
  124. $cfg['UploadDir'] = '';
  125. $cfg['SaveDir'] = '';
  126. /*
  127. * Temp dir for faster beahivour
  128. *
  129. */
  130. $cfg['TempDir'] = '/tmp';
  131. /* Support additional configurations */
  132. foreach (glob('/etc/phpmyadmin/conf.d/*.php') as $filename)
  133. {
  134. include($filename);
  135. }