localhost/phpmyadmin is giving 404 error and http://localhost in thr url is not showing any file list

localhost/phpmyadmin is giving 404 error and in thr url is not showing any file list.

I have changed the ServerName in every conf file. Actually it was just happened recently. I was about to install laravel (a php based framework) in my local machine. It was said to change the virtualhost in apache2 configuration and so I did. But now this has created the problem.

Help me please. I am in a very bad situation.

3 Answers

You will need to configure your apache2.conf to make phpMyAdmin works.

sudo nano /etc/apache2/apache2.conf

Then add the following line to the end of the file.

Include /etc/phpmyadmin/apache.conf

Then restart apache

/etc/init.d/apache2 restart

If the localhost/phpmyadmin give error 404 maybe you can check the symlink.

sudo ln -s /usr/share/phpmyadmin /var/www
sudo a2enconf phpmyadmin
sudo service apache2 reload

Please check the output when you type localhost on your browser the output is apache homepage.

4

The 404 or Not Found error message indicates that the client was able to communicate with a given server, but the server could not find what was requested.

The web site hosting server will typically generate a "404 Not Found" web page when a user attempts to follow a broken or dead link, such as when the requested file (page) is not at that URL, which will most likely mean that your phpmyadmin is not located at or symlinked to .

I have previously come across this situation personally and my solution was actually very simple;

Copy/move phpmyadmin into /var/www or wherever you store your web files:

cp -R '/usr/share/phpmyadmin' '/var/www/'

Then create a new VirtualHost in your apache.conf file, or as I do have a .conf for each VirtualHost. Bare in mind you will have to make sure there are no conflicting VirtualHost's, a simple straight forward VirtualHost phpmyadmin.conf file;

<VirtualHost *:80>
ServerName phpmyadmin.local
ServerAdmin
DocumentRoot /var/www/phpmyadmin <Directory var/www/phpmyadmin> AllowOverride All Order allow,deny Allow from all Require all granted </Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

Don't forget to do;

sudo service apache2 restart

You can then go one step further in your organization regarding your setup, you may notice that my ServerName is phpmyadmin.local, this the most simple thing to do and its known as local subdomains. To implement this you will need to do the following (of course choose your favorite text editor);

sudo gedit /etc/hosts

And here is my hosts file, full to the brim of local subdomains;

127.0.0.1 localhost
127.0.1.1 jack-mint
127.0.0.1 filmod.tk.local
127.0.0.1 filmod.uk.to.local
127.0.0.1 facebook-phishing.local
127.0.0.1 phishing
127.0.0.1 new.uksss.home
127.0.0.1 theystolemybaby.uk.local
127.0.0.1 theystolemybaby.uk.to
127.0.0.1 theystolemybaby.uk
127.0.0.1 theystolemybaby.uk.undo.it.local
127.0.0.1 theystolemymail.local
127.0.0.1 phpmyadmin.local
127.0.0.1 owa.local
127.0.0.1 itools.uk.to.local
127.0.0.1 facebook-phishing.local
127.0.0.1 lite.ml.local
127.0.0.1 rsync.local
127.0.0.1 babysnatchers.local
127.0.0.1 soon.local
10.0.0.5 sams.eth.local <- this is another machine on my network
10.0.0.6 kali.wlan.local <- as is this
127.0.0.1 hiawatha.monitor.local
127.0.0.1 hiawatha.local
127.0.0.1 w3schools.local
127.0.0.1 banshee.local
127.0.0.1 italk.local
127.0.0.1 wp-filmod.local
127.0.0.1 wordpress.local
127.0.0.1 wordpress4.3.local
127.0.0.1 films.local
127.0.0.1 movie-db
127.0.0.1 example-code.local
127.0.0.1 pythonscraping.local
# temp
#10.42.0.1 italk.local <- this is also another machine on my network
192.168.43.93 wp-filmod.local <- as is this

You can literally use nearly anything you want but I guess its good practice to use 'subdomain.domain'. You can use IP addresses from your entire network, essentially what you put in the hosts file an IP address that when typed in your local browser your system will first look at your hosts file and if that URL isnt in there you will be forwarded to an external DNS. Basically this a local DNS service that works like a charm.

And then in my browser I use the URL or just phpmyadmin.local

11

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like