Tutorial

How To Install and Secure phpMyAdmin on Ubuntu 14.04

How To Install and Secure phpMyAdmin on Ubuntu 14.04
Not using Ubuntu 14.04?Choose a different version or distribution.
Ubuntu 14.04

Introduction

While many users need the functionality of a database management system like MySQL, they may not feel comfortable interacting with the system solely from the MySQL prompt.

phpMyAdmin was created so that users can interact with MySQL through a web interface. In this guide, we’ll discuss how to install and secure phpMyAdmin so that you can safely use it to manage your databases on Ubuntu 14.04.

Note: phpMyAdmin can be installed automatically on your Droplet by adding this script to its User Data when launching it. Check out this tutorial to learn more about Droplet User Data.

Prerequisites

Before you get started with this guide, you need to have some basic steps completed.

First, we’ll assume that you are using a non-root user with sudo privileges, as described in steps 1-4 in the initial server setup of Ubuntu 14.04.

We’re also going to assume that you’ve completed a LAMP (Linux, Apache, MySQL, and PHP) installation on your Ubuntu 14.04 server. If this is not completed yet, you can follow this guide on installing a LAMP stack on Ubuntu 14.04.

Once you are finished with these steps, you’re ready to get started with this guide.

Step One — Install phpMyAdmin

To get started, we can simply install phpMyAdmin from the default Ubuntu repositories.

We can do this by updating our local package index and then using the apt packaging system to pull down the files and install them on our system:

sudo apt-get update
sudo apt-get install phpmyadmin

This will ask you a few questions in order to configure your installation correctly.

Warning

When the first prompt appears, apache2 is highlighted, but not selected. If you do not hit “SPACE” to select Apache, the installer will not move the necessary files during installation. Hit “SPACE”, “TAB”, and then “ENTER” to select Apache.

  • For the server selection, choose apache2.
  • Select yes when asked whether to use dbconfig-common to set up the database
  • You will be prompted for your database administrator’s password
  • You will then be asked to choose and confirm a password for the phpMyAdmin application itself

The installation process actually adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is automatically read.

The only thing we need to do is explicitly enable the php5-mcrypt extension, which we can do by typing:

sudo php5enmod mcrypt

Afterwards, you’ll need to restart Apache for your changes to be recognized:

sudo service apache2 restart

You can now access the web interface by visiting your server’s domain name or public IP address followed by /phpmyadmin:

<pre> http://<span class=“highlight”>domain_name_or_IP</span>/phpmyadmin </pre>

phpmyadmin login screen

You can now log into the interface using the root username and the administrative password you set up during the MySQL installation.

When you log in, you’ll see the user interface, which will look something like this:

phpmyadmin user interface

Step Two — Secure your phpMyAdmin Instance

We were able to get our phpMyAdmin interface up and running fairly easily. However, we are not done yet. Because of its ubiquity, phpMyAdmin is a popular target for attackers. We need to secure the application to help prevent unauthorized use.

One of the easiest way of doing this is to place a gateway in front of the entire application. We can do this using Apache’s built-in .htaccess authentication and authorization functionalities.

Configure Apache to Allow .htaccess Overrides

First, we need to enable the use of .htaccess file overrides by editing our Apache configuration file.

We will edit the linked file that has been placed in our Apache configuration directory:

sudo nano /etc/apache2/conf-available/phpmyadmin.conf

We need to add an AllowOverride All directive within the <Directory /usr/share/phpmyadmin> section of the configuration file, like this:

<pre> <Directory /usr/share/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php <span class=“highlight”>AllowOverride All</span> . . . </pre>

When you have added this line, save and close the file.

To implement the changes you made, restart Apache:

sudo service apache2 restart

Create an .htaccess File

Now that we have enabled .htaccess use for our application, we need to create one to actually implement some security.

In order for this to be successful, the file must be created within the application directory. We can create the necessary file and open it in our text editor with root privileges by typing:

sudo nano /usr/share/phpmyadmin/.htaccess

Within this file, we need to enter the following information:

AuthType Basic
AuthName "Restricted Files"
AuthUserFile /etc/phpmyadmin/.htpasswd
Require valid-user

Let’s go over what each of these lines mean:

  • AuthType Basic: This line specifies the authentication type that we are implementing. This type will implement password authentication using a password file.
  • AuthName: This sets the message for the authentication dialog box. You should keep this generic so that unauthorized users won’t gain any information about what is being protected.
  • AuthUserFile: This sets the location of the password file that will be used for authentication. This should be outside of the directories that are being served. We will create this file shortly.
  • Require valid-user: This specifies that only authenticated users should be given access to this resource. This is what actually stops unauthorized users from entering.

When you are finished, save and close the file.

Create the .htpasswd file for Authentication

Now that we have specified a location for our password file through the use of the AuthUserFile directive within our .htaccess file, we need to create this file.

We actually need an additional package to complete this process. We can install it from our default repositories:

sudo apt-get install apache2-utils

Afterward, we will have the htpasswd utility available.

The location that we selected for the password file was “/etc/phpmyadmin/.htpasswd”. Let’s create this file and pass it an initial user by typing:

<pre> sudo htpasswd -c /etc/phpmyadmin/.htpasswd <span class=“highlight”>username</span> </pre>

You will be prompted to select and confirm a password for the user you are creating. Afterwards, the file is created with the hashed password that you entered.

If you want to enter an additional user, you need to do so without the -c flag, like this:

<pre> sudo htpasswd /etc/phpmyadmin/.htpasswd <span class=“highlight”>additionaluser</span> </pre>

Now, when you access your phpMyAdmin subdirectory, you will be prompted for the additional account name and password that you just configured:

<pre> http://<span class=“highlight”>domain_name_or_IP</span>/phpmyadmin </pre>

phpMyAdmin apache password

After entering the Apache authentication, you’ll be taken to the regular phpMyAdmin authentication page to enter your other credentials. This will add an additional layer of security since phpMyAdmin has suffered from vulnerabilities in the past.

Conclusion

You should now have phpMyAdmin configured and ready to use on your Ubuntu 14.04 server. Using this interface, you can easily create databases, users, tables, etc., and perform the usual operations like deleting and modifying structures and data.

To learn how to further secure your interactions with the server by encrypting your communication with SSL, check out our article on setting up SSL certificates with phpMyAdmin.

<div class=“author”>By Justin Ellingwood</div>

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author(s)

Justin Ellingwood
Justin Ellingwood
See author profile
Category:
Tutorial

Still looking for an answer?

Ask a questionSearch for more help

Was this helpful?
 
80 Comments
Leave a comment...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Hey! Thanks for the tutorial. I ran into a problem though, I get a 404 not found error when visiting http://myserver/phpmyadmin/ (where ‘myserver’ is my ip adress’). The strange thing is that the PMA favicon is showing. When I visit http://myserver/ the apache configuration page shows fine. Any idea why phpmyadmin can’t be found?

Thanks! Nic

same with me. did you solve that? could you please help me?

For the next person who may run into this issue, I needed to purge the install and reinstall remembering to hit space bar & tab when it asks to select apache.

sudo apt-get purge phpmyadmin

follow uninstall prompts and then reinstall

make sure you add this on the following bottom of your apache2.conf (on /etc/apache2/apache2.conf) " Include /etc/phpmyadmin/apache.conf " #withoutquote

And try service apache2 restart :)

Works. Thank you.

gan mau nanya, ane bisa buat pass di http://domain_name_or_IP/phpmyadmin, tp kok ane ketik di http://domain_name_or_IP/ kok ask password juga ya? itu knp ya?

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
April 24, 2014

Could you post any relevant information from your Apache log?

<pre> tail /var/log/apache2/error.log </pre>

The log doesn’t show any relevant information, only multiple instances of this: <pre> [Thu Apr 24 10:55:18.746603 2014] [core:notice] [pid 10813] AH00094: Command line: ‘/usr/sbin/apache2’ [Thu Apr 24 10:59:56.400419 2014] [mpm_prefork:notice] [pid 10813] AH00169: caught SIGTERM, shutting down [Thu Apr 24 10:59:57.489426 2014] [mpm_prefork:notice] [pid 10873] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4 configured – resuming normal operations </pre> But I got it to work. Strangely I didn’t find any phpmyadmin conf file in <code>/etc/apache2/conf-enabled/</code>, so I used the method as described in the Ubuntu 12.04 tutorial and included phpmyadmin’s conf file in <code>/etc/apache2/apache2.conf</code>. For the .htaccess security procedures I used the conf file in the phpmyadmin directory. Everything now works as it should :)

I think why it didn’t work is because the phpmyadmin.conf file was not added to the <code>/etc/apache2/conf-enabled/</code> directory. Do you know why this might be the case?

The .conf file for me wasn’t put in the right place either. You need to manually copy it over like this:

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-enabled/phpmyadmin.conf

Got an 404 error when I access http://domain_name_or_IP/phpmyadmin

Solution: manually copy over the the PHPMyAdmin Apache conf file over to the conf-available directory:

sudo cp /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf

Then enabled the Apache conf file using a2enconf:

sudo a2enconf phpmyadmin

still not working for me…any suggestions how to do it?

1.5 years later and this post just solved the exact same problem for me! Gratzi!

Justin Ellingwood
DigitalOcean Employee
DigitalOcean Employee badge
April 25, 2014

Thanks for the heads up everyone.

The problems that you are describing indicate that you never actually selected “Apache” for your web server during the phpMyAdmin installation processes. Although that option is highlighted by the installer, you need to hit “SPACE” to check the box and select that option.

This is the part of the configuration that lets phpMyAdmin know that you wish to move the files into the Apache configuration hierarchy.

I have updated the guide to make this a bit more clear. Please let us know if you have any additional problems.

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
June 23, 2015

This comment has been deleted

    Hi This is the best i have seen for some time i spent 2 weeks trying to get server 2008 r2 to do the same thing and it took me about 2 hours to do the full install and configure this.

    well done ubuntu you won me over… Many thanks

    Richard C

    Thanks for the tutorial. Very helpful. Just have one question. How to I change the phpmyadmin default http directory? I mean I don’t want to use http://ip/phpmyadmin as visiting link because it’s too easy to guess.

    Thanks!

    Andrew SB
    DigitalOcean Employee
    DigitalOcean Employee badge
    June 2, 2014

    @yalunren: To change the url, edit the phpmyadmin.conf file:

    <pre> sudo nano /etc/apache2/conf-available/phpmyadmin.conf </pre>

    File the “Alias” line and change the first part to the url you want. For instance, change:

    <pre> Alias /phpmyadmin /usr/share/phpmyadmin </pre>

    to

    <pre> Alias /somethingelse /usr/share/phpmyadmin </pre>

    Then restart Apache:

    <pre> sudo service apache2 restart </pre>

    Now, phpmyadmin is available at http://your.ip.address/somethingelse

    @Andrew SB : Great, thanks!

    Followed security procedures but not getting the apache login box… page loads phpmyadmin right away - I did restart Apache

    Actually works now. You need to edit the phpmyadmin.conf in the conf-enabled dir NOT conf-available

    In the setup for phpmyadmin I’m asked to create a password for accessing it. But when I get to the login screen that password fails, I have to use the MySQL root password, am I missing something or did something wrong during install? (Love the guide BTW, thanks for helping!)

    hello i have follow all the steps and everything is fine except the “popup” validation for phpmyadmin, it never loads, can anyone help me please?

    Kamal Nasser
    DigitalOcean Employee
    DigitalOcean Employee badge
    July 13, 2014

    @luisdiazvenero: Can you pastebin the contents of /etc/apache2/conf-available/phpmyadmin.conf?

    Hi All,

    How do i change the password which i have create inside the .htpasswd? Using this commmand “sudo htpasswd -c /etc/phpmyadmin/.htpasswd username”

    Thanks Simeon

    Kamal Nasser
    DigitalOcean Employee
    DigitalOcean Employee badge
    July 15, 2014

    @nubletss: Delete the current user:

    sudo htpasswd -D /etc/phpmyadmin/.htpasswd username
    

    and then re-add it with a new password:

    sudo htpasswd -c /etc/phpmyadmin/.htpasswd username
    

    Can’t get the apache login before the phpmyadmin login to work, any suggestions.

    contents of /etc/apache2/conf-available/phpmyadmin.conf

    contents of /usr/share/phpmyadmin/.htaccess

    and /etc/phpmyadmin/.htpasswd has a username:pass

    have restarted apache

    and if I run: “sudo a2enconf phpmyadmin” says its already enabled.

    Thanks!

    Kamal Nasser
    DigitalOcean Employee
    DigitalOcean Employee badge
    July 29, 2014

    @hello: If you take a closer look at https://kmlnsr.me/Screenshot%20from%202014-07-30%2001%3A07%3A56-ntgtXsp8jg5gPZX81TImrJYg3ARuZijP.png, you’ll see that it’s applying to rules to /phpmyadmin/setup/*. Try replacing /usr/share/phpmyadmin/setup with /usr/share/phpmyadmin. Also replace .htpasswd.setup with .htpasswd.

    Finally, restart apache:

    sudo service apache2 restart
    

    @Kamal Nasser:

    Thanks will try. Still new to apache and well server admin in general. ; )

    Should have metioned, I added the AllowOverride All in the top part under the /usr/share/phpmyadmin declarations.

    I assume that should tell it to look for rewrite rules in an .htaccess in that directory.

    anyway, we’ll see what I can do. Thanks!

    uhh… it was my own dumb mistake. Had a typo in a new bash alias I made for restarting the server.

    Working now, didn’t have to change /setup

    I have a strange problem. I create a new (non-root) user, I try to install phpmyadmin using that new user and, after typing sudo apt-get install phpmyadmin and being asked for passwords and configuration settings (as described in Step One), I’ve got an error saying user ‘root@myserver’ does not have privileges to proceed. But I am not using root! :S

    Can someone put some light here?

    Thanks in advance.

    I get a 404 not found error You can create a link: sudo ln -s /usr/share/phpmyadmin /var/www/html

    I followed the above instruction but I’m getting this error

    The requested URL /phpmyadmin/ was not found on this server.
    

    And how the instruction here differs from the following link?

    This is the console error message

    Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message.
    

    Please advise on what to do next. Thanks!

    Please ignore the above Q. I’ve managed to solve it.

    Now when I go to

    sudo nano /etc/apache2/conf-available/phpmyadmin.conf
    

    the file is empty.

    Is it normal?

    This happened to me too. Why does the path

    /etc/apache2/conf-available/phpmyadmin.conf
    

    empty?

    EDIT: Got the html phpmyadmin fixed

    but I can’t login? #1045 Cannot log in to the MySQL server

    Thank you so much … helped me !!

    Hi, phpmyadmin worked to me with this tutorial (also with popup where it asked user and pass to access to real login of phpmyadmin).

    But then I added .htaccess file to /www/ folder to redirect from http://ip-my-vps/ to http://my-real-domain.com. I have also installed Cloudflare and mod_cloudflare to restore original visitor IP in my Apache logs.

    And now I haven’t popup but only 403 error:

    Forbidden

    You don’t have permission to access /phpmyadmin on this server.

    :(

    In /etc/apache2/conf.d/security (Debian 7) I have:

    <Directory /> AllowOverride None Order Deny,Allow Deny from all </Directory>

    Can to be this the problem? Is better to install VirtualMin and manage MySql databases with it?

    Thank you vey much in advance

    Kamal Nasser
    DigitalOcean Employee
    DigitalOcean Employee badge
    October 5, 2014

    Try adding

    Order Deny,Allow
    Allow from All
    

    after <Directory /usr/share/phpmyadmin> and restart Apache: sudo service apache2 restart. Does that fix it? If not, check if there are any errors in Apache’s error log:

    sudo tail /var/log/apache2/error.log
    

    This comment has been deleted

      This comment has been deleted

        Please review me, am i on the right direction. Last result i done, prompt question username & password will appear everytime someone browse example.com/phpmyadmin/ , by this if we input right credential, then page will open for us to once again input for root username & root password.

        Thanks for any advance comment.

        Is there any way to assign phpmyadmin to a port?

        Great tutorial, worked out of the box for me, I signed up especially to say ‘thank you’. And selecting Apache2 with the spacebar would have been a dealbreaker for sure if you hadn’t mentioned that. Good writing style too. (I write tutorials myself, so I should know…)

        This is really clear and helpful. Thank you very much :DDD

        this is awesome, Thank you!

        Can you please add a section {How To remove phpMyAdmin on Ubuntu 14.04}

        Kamal Nasser
        DigitalOcean Employee
        DigitalOcean Employee badge
        December 22, 2014

        You can disable phpmyadmin by running:

        sudo a2dissite phpmyadmin
        sudo service apache2 reload
        

        If you want to completely uninstall it, all you need to do is purge the phpmyadmin command and delete any files that may be left over:

        sudo apt-get purge phpmyadmin
        sudo rm /etc/phpmyadmin /usr/share/phpmyadmin -r
        sudo rm /etc/apache2/conf-available/phpmyadmin.conf
        sudo service apache2 reload
        

        How to reset /change user and password of phpmyadmin.

        Actually i could not login into it. getting error #1045 can not log in to the mysql.

        unseenmoviemistakes.com/phpmyadmin

        @asb , @kamaln7 , please help my out.

        Kamal Nasser
        DigitalOcean Employee
        DigitalOcean Employee badge
        December 28, 2014

        @lawdabalma: To reset your MySQL root password, log in via SSH as root and:

        1 - Stop MySQL if it’s already running: sudo service mysql stop 2 - Run: mysqld_safe --skip-grant-tables & 3 - Log in to MySQL as root: mysql -u root 4 - Reset the password:

        mysql> use mysql;
        mysql> update user set password = PASSWORD("new root password here") where User = 'root';
        mysql> flush privileges;
        mysql> quit
        

        5 - Stop the mysqld_safe process: pkill $1; sudo service mysql stop 6 - Start MySQL: sudo service mysql start

        @kamaln7 I also got the error #1045 and i performed your solution. But now its possible to login with any username/password combination you enter.

        I also can’t create databases when logged in to phpmyadmin.

        This comment has been deleted

          Correction for the tutorial, to fix the #1045 error.

          Tutorial: “You can now log into the interface using the root username and the administrative password you set up during the MySQL installation.”

          Should be: “You can now log into the interface with the username “phpmyadmin” and the administrative password you set up during the MySQL installation.”

          That password can be found in the file /etc/phpmyadmin/config-db.php

          The instructions by @kamaln7 below are for changing the password for “root”, which would probably also work if you want to log into PHPMyAdmin as root.

          Thanks a lot kitchin. I struggled with this for two days. You made my day !

          after the step one, result is;

          “The requested URL /phpmyadmin was not found on this server.”

          do you have any solution for that?

          yeah. i solved that. here is the solution.

          at the end of the step 1, its not working. when you saw that, try below tutorial’s line of;

          sudo nano /etc/apache2/apache2.conf

          https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-12-04

          This is very helpful! Thanks for the great tutorial!

          This comment has been deleted

            How do i reset my gateway extra layout password? I forgot it?

            This tut is epic. Thank You so much.

            Thanks for this tutorial. But the author forgot to tell how to link the phpmyadmin source file to /var/www/html, so that it can be accessed publicly. I’m sure most of you must have got an error such as “phpmyadmin not found”. Try using this command:

            ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin
            

            So, whenever user try to open http://[ip_address]/phpmyadmin, it will go to open successfully.

            The only way I could get the password protection of the directory to work was to modify the file in /etc/apache2/conf-enabled/phpmyadmin.conf instead of /etc/apache2/conf-available/phpmyadmin.conf

            Just in case you pressed ENTER instead of following the steps provided on phpmyadmin setup, use this to open configuration screen back: sudo dpkg-reconfigure phpmyadmin

            hey I delete the phpmyadmin folder and the i try to again install sudo apt-get install phpmyadmin it says" phpmyadmin is already the newest version." but when i go to etc folder no phpmyadmin folder found what i have to do

            After installation, nothing happened after type http://myIP/phpmyadmin

            I went to the www folder, and only see two files there, one is the info.php, the other is ubuntu default page. Where is the phpmyadmin folder?

            Justin Ellingwood
            DigitalOcean Employee
            DigitalOcean Employee badge
            March 9, 2015

            During the installation, make sure you hit the space bar to ensure that it correctly links the files for Apache. You can run through the configuration screen again by typing:

            sudo dpkg-reconfigure phpmyadmin
            

            When asked what server you will use, make sure Apache is selected.

            I created my Droplet with Wordpress being set up automatically so I chose NO when asked if I wanted to use dbconfig-common to set up mysql. I’m not sure if that was necessary but I didn’t want to mess up the site I already have installed.

            Now I’m not sure how to log in to phpMyAdmin as the root user. I can’t remember if I chose a root password at any point during the setup process. Do I just have to reset the root password at this point?

            This comment has been deleted

              You need to secure this with SSL.

              After installing phpmyadmin i am still not able to open it for my localhost. It says error 404. Any suggestions how to solve it?

              Thanks for the tutorial, but I didn’t know that we needed to press SPACE to check the apache box. I always read to fast hehe, my fault :P

              sudo php5enmod mcrypt gives me error WARNING : Not enabling the mcrypt module for apache2 SAPI since module symlink WARNING : already exists in /etc/php5/apache2/conf.d with different content WARNING : Not enabling the mcrypt module for apache2 SAPI since module symlink WARNING : already exists in /etc/php5/apache2/conf.d with different content

              what to do ?

              Need Help. I’m stuck in this step

              You will be prompted for your database administrator’s password You will then be asked to choose and confirm a password for the phpMyAdmin application itself

              Where I can find database administrator’s password ?

              It’s on the SSH welcome screen every time you login.

              “sudo nano /etc/apache2/conf-available/phpmyadmin.conf”

              Mine seems to be blank…

              What now?

              I believe it’s important to restrict access to phpMyAdmin to SSL (https) only too, in addition to everything the author has listed. This is additional layer of security is important because it’s quite easy to eavesdrop on the http auth protocol and discover the username / password used. Someone could break into your server – just by having PMA installed – if this level of security isn’t enabled.

              Did everything, but after securing phpmyadmin, I get the additional login screen, enter the username and password, and instead of taking me to the phpmyadmin screen i just get a 500 internal server error… Anyone who can help?

              Hi. First, I did initial server setup of ubuntu, i added new user , gave him sudo privileges, but i didn’t add public key authentication because i already have a problem adding ssh keys for root, and i’m waiting for response from DO. And i didn’t configure SSH Daemon because when i open /etc/ssh/sshd_config, there is no lines there. And i didn’t go trough “installing a LAMP stack on Ubuntu 14.04” because when i created droplet, i chose droplet image LAMP.

              So, i logged in to my user with sudo privileges, did everything from step one, but when i try to loggin to my php admin, i get 2 messages: “#1045 Cannot log in to the MySQL server” and “Connection for controluser as defined in your configuration failed.”

              And also, i got this message while installing http://www.dodaj.rs/f/3F/NX/2tJdSLhr/geeska.png

              What should i do?

              Hi,

              Thank you for this information, great one.

              your warning just save my day

              Hello.

              How can I add phpmyadmin to different hosts? It works for my default site but sometimes I enable my second site and it never appears.

              Thank you.

              This comment has been deleted

                Fantastic and simple guide to getting phpmyadmin up and running. Perfect for helping me change a WordPress username following an attempted breach.

                Many thanks.

                thanks for you very match this really was help full … i love u :-)

                Hello i configured an apache virtualhost in ubuntu . apache version is 2.4.7 and i wanna use php-fpm . both virtual hosts show blank pages . Nginx works very good in server , and there is no error while i restarting services . The html pages open correctly but not about .php pages . my virtualhost config file :

                <VirtualHost 192.168.10.51:80> ServerName mim1.ap ServerAlias www.mim1.ap #Include conf.modules.d/*.conf DocumentRoot /var/www/mim1.ap/public AddHandler php5-fcgi .php #AddType application/x-httpd-fastphp .php #Action application/x-httpd-fastphp /php-fpm ErrorLog /var/www/mim1.ap/logs/error_log CustomLog /var/www/mim1.ap/logs/access.log combined #php_admin_value open_basedir /var/www/vhosts/mehrdad.loc/httpdocs/:/tmp/ #php_admin_value allow_url_fopen /var/www/vhosts/mehrdad.loc/httpdocs/:/var/www/vhosts/mehrdad.loc/httpdocs/tmp/ #php_admin_value upload_tmp_dir /var/www/vhosts/mehrdad.loc/httpdocs/tmp/:/tmp/

                <Proxy fcgi://mim1.ap> ProxySet connectiontimeout=5 timeout=240 </Proxy> <FilesMatch .php$> SetHandler “proxy:unix:/var/run/php5-fpm.mim1.ap.sock|fcgi://mim1.ap/” </FilesMatch>

                <Directory “/var/www/mim1.ap/public”> Order allow,deny Allow from all AllowOverride FileInfo All # New directive needed in Apache 2.4.3: Require all granted </Directory>

                </VirtualHost>

                For those who are having a problem of 404(page not found) when you go to http:://yourip/phpmyadmin follow the following

                Install phpMyAdmin

                For me all the steps described were not really necessary,maybe in older versions of apache

                404 page error while accessing IP/phpmyadmin?

                I resolved by the following command and installing get text

                sudo apt-get install php-gettext
                

                Thanks for the tutorial Justin, went through it with a little help but for some reason now I cannot login, I am pretty sure I am using the password I set up. If anyone can help here is a current screenshot. Thanks a lot. http://screencast.com/t/X5sH1XFPm

                ps. I am quite new to all this.

                Thanks.

                Craig

                After following this guide and using the following:

                sudo nano /etc/apache2/conf-available/phpmyadmin.conf

                The file is empty. Does anyone have any suggestions on how to proceed?

                Not Found

                The requested URL /phpmyadmin was not found on this server.

                Apache/2.4.18 (Ubuntu) Server at 192.168.1.131 Port 80

                how to solve this error?

                Getting

                #1045 - Access denied for user 'username'@'localhost' (using password: YES)
                

                Do I need to grant permissions, and if so where? Thanks!

                “root” wasn’t the username to log into my phpMyAdmin interface. Mine was “phpmyadmin”. I had figure it out by reading/gedit at the db cofing file that is located at: sudo -H gedit /etc/dbconfig-common/phpmyadmin.conf

                /etc/dbconfig-common/phpmyadmin.conf

                Hi, I have been trying to get the extra authentication from .htaccess working but the popup is not showing up. This is my .htaccess file and this is my apache config. My .htpasswd looks fine with the username and encrypted password and I can login just fine; no popup though.

                Hope someone can help. -Dom

                Someone already mentioned this, but I’m posting again since it never got changed in the tutorial.

                The “root” user did not work at the end of step one. Use “phpmyadmin” instead.

                The line should say: “You can now log into the interface using the phpmyadmin username and the administrative password you set up during the MySQL installation.”

                tanks terima kasih

                Easy to follow and well explained. Thanks

                Since this phpmyadmin is just a small area, and is not one of your websites, and you have to become root anyway, instead of creating a .htaccess file, just add your desired command to the config file instead of adding AllowOverride All.

                So then it will look like :

                <Directory /usr/share/phpmyadmin>
                    Options FollowSymLinks
                    DirectoryIndex index.php
                AuthType Basic
                AuthName "Restricted Files"
                AuthUserFile /etc/phpmyadmin/.htpasswd
                Require valid-user
                

                Wayne Sallee Wayne@WayneSallee.com

                Please please please 🤗😭😩😫😠😡

                The digital ocean team is requesting that you update this page. According to the information given here, we tried to create PHP My Admin Panel on my digitalocean console but But I have had 10 - 20 problems, whose solution has not been explained here. We request you that Upload a screen recording video, It explains how PHP My Admin Panel creates. With the help of which we will be able to create step by step PHP My Admin Panel.

                Mainly include the following problems on Windows 10 Desktop Computer.

                1. After completing all the commands on my digitalocean console. the PHP My Admin Panel logs in user name and password incorrectly. Even when we wrote the username and password correctly and who also wrote the same username and password in the my console, this problem still occurs.

                That’s why we deleted the Maid admin panel.

                We once again installed the php admin panel.

                1. This time our website URL did not open nareshmeena.com/phpMyAdmin .

                2. Many times " the file is empty" this message comes.

                So we have installed the PHP My Admin panel several times and even deleted it, we still can not make the PHP MY Admin panel.

                🤗 Some time ago we had installed a plugin on our wp website. After installing which we were unable to login to our site. The website is completely closed. That’s why we tried to remove plugin through the PHP My Admin Panel.

                More than a million people visit our website every day. Please help us.

                Try DigitalOcean for free

                Click below to sign up and get $200 of credit to try our products over 60 days!

                Sign up

                Join the Tech Talk
                Success! Thank you! Please check your email for further details.

                Please complete your information!

                Become a contributor for community

                Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

                DigitalOcean Documentation

                Full documentation for every DigitalOcean product.

                Resources for startups and SMBs

                The Wave has everything you need to know about building a business, from raising funding to marketing your product.

                Get our newsletter

                Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

                New accounts only. By submitting your email you agree to our Privacy Policy

                The developer cloud

                Scale up as you grow — whether you're running one virtual machine or ten thousand.

                Get started for free

                Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

                *This promotional offer applies to new accounts only.