Question

Access to phpMyAdmin on Centos7 suddenly stopped working after server reboot.

I set up my Centos7 server about 2 months ago.

phpMyAdmin has been working fine. Yesterday I stopped and restarted the server. Now everything else appears fine, but when I try and access phpmyadmin I get the browser message:

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

I have googled extensively and as far as I can see, everything is set up correctly.

My phpMyAdmin.conf file contains (relevant parts only):

Alias /phpMyAdmin /usr/share/phpMyAdmin
Alias /phpmyadmin /usr/share/phpMyAdmin

<Directory /usr/share/phpMyAdmin/>
   AddDefaultCharset UTF-8

   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
      #   Require ip 127.0.0.1
       # Require ip ::1
       Require all granted
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     #Deny from All
     #Allow from 127.0.0.1
     #Allow from ::1
     allow from all
     Require all granted
   </IfModule>
</Directory>

<Directory /usr/share/phpMyAdmin/setup/>
   <IfModule mod_authz_core.c>
     # Apache 2.4
     <RequireAny>
        #  Require ip 127.0.0.1
       # Require ip ::1
       Require all granted  
     </RequireAny>
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order Deny,Allow
     allow from All
     # Allow from 127.0.0.1
     # Allow from ::1
   </IfModule>
</Directory>

http.conf contains:

<IfModule dir_module>
    DirectoryIndex index.html index.php
</IfModule>

I do have an index.php file in /var/www.html.

Whenever I attempt to access phpMyAdmin, my apache error log shows

Cannot serve directory /usr/share/phpMyAdmin/: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive

I have definitely stopped and restarted Apache, rebooted the server etc, and nothing has improved.

All ideas welcome.


Submit an answer

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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This is likely due to a permissions misconfiguration, or potential ownership issues with the /usr/share/phpMyAdmin/ folder or your /var/www/html/ folder. The logs are likely in /var/log/ and should indicate more specifically what the error is, but this guide should also be very helpful for both configuration and security - https://www.digitalocean.com/community/tutorials/how-to-install-and-secure-phpmyadmin-on-ubuntu-16-04