How do you configure phpmyadmin on linux?

Asked

Viewed 3,932 times

0

I gave one apt-get install phpmyadmin and linux did the installation in the folder etc; rode in the browser http://localhost/phpmyadmin and gave error 404. I changed and played the phpmyadmin folder inside the directory www, but it just shows the Apache interface and the folder arch list. It doesn’t open the phpmyamind interface like in Windows. What should I do?

3 answers

1

Installing using apt-get, in some versions of Ubuntu/Ubuntu server it is necessary to directly add the phpmyadmin path in the apache configuration file, so type in the terminal:

vim /etc/apache2/apache2.conf

Appendage a last line with the parameter below and save the file

Include /etc/phpmyadmin/apache.conf

Then restart the apache:

service apache2 restart

Since you invented to change the folder and such, if it doesn’t work out, uninstall, install and follow what I said up there. Another way is to install by downloading the package instead of using apt-get:

In the terminal enter your apache root folder, usually /var/www/ or /var/www/html

Download the file in https://www.phpmyadmin.net/

wget https://files.phpmyadmin.net/phpMyAdmin/4.5.2/phpMyAdmin-4.5.2-all-languages.zip

unzip phpMyAdmin-4.5.2-all-languages.zip

mv phpMyAdmin-4.5.2-all-languages phpmyadmin

Ready! Log in http://localhost/phpmyadmin.

*Remember that the phpmyadmin login screen makes a connection to the mysql server. If your mysql server password is empty, you need to change the phpMyAdmin configuration file to allow empty password logins. For this we will edit the file:

vim /var/www/phpmyadmin/libraries/config.default.php

Find the line $cfg[ǐ Servers'][$i][pra Allownopassword'] = ";

Replace with

$cfg[pra Servers'][$i][pra Allownopassword'] = and true';

Save and close the file. Ready!

1

By default, apt-get install phpmyadmin installs and create a file /etc/apache2/conf. d/phpmyadmin.conf.

Contents page is on /usr/share/phpmyadmin/

Take a look:

/etc/apache2/conf. d/phpmyadmin.conf

# phpMyAdmin default Apache configuration

Alias /dbo /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin>
        Options FollowSymLinks
        DirectoryIndex index.php

        <IfModule mod_php5.c>
                AddType application/x-httpd-php .php

                php_flag magic_quotes_gpc Off
                php_flag track_vars On
                php_flag register_globals Off
                php_admin_flag allow_url_fopen Off
                php_value include_path .
                php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp
                php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyad                                                                                                              min/:/var/lib/phpmyadmin/
        </IfModule>

</Directory>

# Authorize for setup
<Directory /usr/share/phpmyadmin/setup>
    <IfModule mod_authn_file.c>
    AuthType Basic
    AuthName "phpMyAdmin Setup"
    AuthUserFile /etc/phpmyadmin/htpasswd.setup
    </IfModule>
    Require valid-user
</Directory>

# Disallow web access to directories that don't need it
<Directory /usr/share/phpmyadmin/libraries>
    Order Deny,Allow
    Deny from All
</Directory>
<Directory /usr/share/phpmyadmin/setup/lib>
    Order Deny,Allow
    Deny from All
</Directory>
  • I didn’t find this file

  • How do I set this up?

  • Because you don’t try before: apt-get remove phpmyadmin and then install again. It’s usually faster.

  • 1

    I tried to dpkg-reconfigure -plow phpmyadmin but I’ll try as you said. I’m desperate I need to set this up before 2pm

  • Worked by reinstalling?

  • It is currently in the folder /etc/httpd/conf.d/phpMyAdmin.conf

Show 1 more comment

0


Download and unzip the files in the directory where you want to access.

Example, if you wanted to access how http://localhost/phpmyadmin, enter the folder of DOCUMENT_ROOT defined in VirtualHost apache. Then create a folder as the name you want "phpmyadmin". Unzip everything in this folder.

Done this, just access http://localhost/phpmyadmin and configure by following the screen instructions.

Obs: I’m considering that your environment is already configured with Apache and http://localhost accessible.

  • 2

    Thank you very much, very much. It worked! Abs!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.