0

localhost/phpmyadmin is giving 404 error and http://localhost 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.

1

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
| improve this answer | |
0

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.

| improve this answer | |
  • sudo a2enconf phpmyadmin – user993616 Oct 21 '16 at 7:33
  • sudo a2enconf phpmyadmin , ERROR: Conf phpmyadmin does not exist! This command is not running... – user993616 Oct 21 '16 at 7:33
  • I have managed to setup phpmyadmin. But localhost in the browser still giving me the same error. – user993616 Oct 21 '16 at 13:05
  • check the screen. – user993616 Oct 21 '16 at 13:06
0

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 http://localhost/phpmyadmin.

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 admin@your-email.com
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 http://phpmyadmin.local or just phpmyadmin.local

| improve this answer | |
  • I can not proceed as your first commend is giving me this error : cp: cannot stat `/usr/share/phpmyadmin': No such file or directory – user993616 Oct 21 '16 at 7:37
  • you will need to find which directory phpmyadmin is sstored in, try; sudo find / -iname 'phpmyadmin' that will find phpmyadmin (infact it may find several things and you will have to work out which one is the actual web files direcory) – Jackherer Oct 21 '16 at 11:09
  • It is in /var/www/phpmyadmin Now tell me how to resolve this issue. – user993616 Oct 21 '16 at 12:48
  • Tell me when you will be online. It would help me to sort out easily otherwise it will take too much time to make conversation over this forum. – user993616 Oct 21 '16 at 12:50
  • hey I'm online and should be online most of today I will be happy to help. – Jackherer Oct 22 '16 at 4:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.