User Tools

Site Tools


phpmyadmin

phpmyadmin-with-Apach2 & PHP7.3

sudo apt install -y php-json php-mbstring php-xml

sudo apt install -y php-json php-mbstring php-xml

wget https://files.phpmyadmin.net/phpMyAdmin/5.1.1/phpMyAdmin-5.1.1-all-languages.tar.gz

tar -zxvf phpMyAdmin-5.1.1-all-languages.tar.gz

sudo mv phpMyAdmin-5.1.1-all-languages /usr/share/phpmyadmin

sudo cp -pr /usr/share/phpmyadmin/config.sample.inc.php /usr/share/phpmyadmin/config.inc.php

sudo vi /usr/share/phpmyadmin/config.inc.php

Generate a blowfish secret and update the secret in the configuration file.

$cfg['blowfish_secret'] = 'CfX1la/aG83gx1{7rADus,iqz8RzeV8x'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */

  • $cfg['Servers'][$i]['controlhost'] = 'localhost';
  • $cfg['Servers'][$i]['controluser'] = 'pma';
  • $cfg['Servers'][$i]['controlpass'] = 'pmapass';
  • $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
  • $cfg['Servers'][$i]['bookmarktable'] = 'pmabookmark'; * $cfg['Servers'][$i]['relation'] = 'pmarelation';
  • $cfg['Servers'][$i]['table_info'] = 'pmatable_info'; * $cfg['Servers'][$i]['table_coords'] = 'pmatable_coords';
  • $cfg['Servers'][$i]['pdf_pages'] = 'pmapdf_pages'; * $cfg['Servers'][$i]['column_info'] = 'pmacolumn_info';
  • $cfg['Servers'][$i]['history'] = 'pmahistory'; * $cfg['Servers'][$i]['table_uiprefs'] = 'pmatable_uiprefs';
  • $cfg['Servers'][$i]['tracking'] = 'pmatracking'; * $cfg['Servers'][$i]['userconfig'] = 'pmauserconfig';
  • $cfg['Servers'][$i]['recent'] = 'pmarecent'; * $cfg['Servers'][$i]['favorite'] = 'pmafavorite';
  • $cfg['Servers'][$i]['users'] = 'pmausers'; * $cfg['Servers'][$i]['usergroups'] = 'pmausergroups';
  • $cfg['Servers'][$i]['navigationhiding'] = 'pmanavigationhiding'; * $cfg['Servers'][$i]['savedsearches'] = 'pmasavedsearches';
  • $cfg['Servers'][$i]['central_columns'] = 'pmacentral_columns'; * $cfg['Servers'][$i]['designer_settings'] = 'pmadesigner_settings';
  • $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';

Add the user and grant permission to phpmyadmin’s database

  • CREATE USER 'pma'@'localhost' IDENTIFIED BY 'pmapass';
  • GRANT ALL PRIVILEGES ON phpmyadmin.* TO 'pma'@'localhost' WITH GRANT OPTION;
  • FLUSH PRIVILEGES;
  • Import the create_tables.sql to create tables for phpmyadmin.
  • sudo mysql < /usr/share/phpMyAdmin/sql/create_tables.sql -u root -p
  • Configure Temp directory:
  • sudo mkdir -p /var/lib/phpmyadmin/tmp
  • sudo chown -R www-data:www-data /var/lib/phpmyadmin
  • sudo mkdir /etc/phpmyadmin/
  • $cfg['TempDir'] = '/var/lib/phpmyadmin/tmp';

Create a file named phpmyadmin.conf in the /etc/apache2/conf-available/ directory:

sudo vim /etc/apache2/conf-enabled/phpmyadmin.conf

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>

   Options SymLinksIfOwnerMatch
   DirectoryIndex index.php

<IfModule mod_php5.c>

       <IfModule mod_mime.c>
           AddType application/x-httpd-php .php
       </IfModule>
       <FilesMatch ".+\.php$">
           SetHandler application/x-httpd-php
       </FilesMatch>

php_value include_path .

       php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
       php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
       php_admin_value mbstring.func_overload 0
   </IfModule>
   <IfModule mod_php.c>
       <IfModule mod_mime.c>
           AddType application/x-httpd-php .php
       </IfModule>
       <FilesMatch ".+\.php$">
           SetHandler application/x-httpd-php
       </FilesMatch>

php_value include_path .

       php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
       php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/php/php-php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/:/usr/share/doc/phpmyadmin/:/usr/share/php/phpseclib/
       php_admin_value mbstring.func_overload 0
   </IfModule>

</Directory>

# Authorize for setup <Directory /usr/share/phpmyadmin/setup>

   <IfModule mod_authz_core.c>
       <IfModule mod_authn_file.c>
           AuthType Basic
           AuthName "phpMyAdmin Setup"
           AuthUserFile /etc/phpmyadmin/htpasswd.setup
       </IfModule>
       Require valid-user
   </IfModule>

</Directory>

# Disallow web access to directories that don't need it <Directory /usr/share/phpmyadmin/templates>

   Require all denied

</Directory> <Directory /usr/share/phpmyadmin/libraries>

   Require all denied

</Directory> <Directory /usr/share/phpmyadmin/setup/lib>

   Require all denied

</Directory>

https://www.digitalocean.com/community/tutorials/how-to-install-phpmyadmin-from-source-debian-10

https://www.phpmyadmin.net/downloads/

phpmyadmin-with-nginx
phpmyadmin.txt · Last modified: 2023/03/06 11:31 by 127.0.0.1