Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

why phpmyadmin shows list of files instead of database?

When i open localhost/phpmyadmin. it shows me list of all files instead of the database. Why it happens ? Any help will be appreciated. below is my screenshot for phpmyadmin enter image description here

like image 482
Nikul Avatar asked Mar 18 '23 07:03

Nikul


1 Answers

This is because the webserver (which I'm guessing is Apache because of the WAMP tag and because of the look of this list) hasn't been told to use index.php as a default file and is configured to show a directory listing instead. It generally means you haven't properly (or fully, anyway) configured your PHP installation, because generally the PHP installation instructions I've seen include this step (or do it automatically). So it's possible you additionally haven't installed PHP at all; which you can quickly test by clicking the index.php link and seeing whether you get a log in page or screen full of gibberish. Anyway, WAMP includes PHP, so I presume at this point that you've just got the index.php configuration problem, so:

In your Apache configuration, find the line for DirectoryIndex. You'll need to add index.php to the list. For example, mine looks like:

DirectoryIndex index.php index.html home.pl index.cgi

You probably don't need all of those and should only add index.php; don't just copy and paste my line, it's just given as an example.

This is the list of files that Apache looks for to run as the main page of a folder/subdirectory. If it can't find any of the listed files then it generally shows the listing of all files in that directory (which is controlled by mod_autoindex, if you're interested in learning more).

like image 111
Isaac Bennetch Avatar answered Mar 21 '23 04:03

Isaac Bennetch