PHP MyAdmin Problem

sharingsunshine
sharingsunshine used Ask the Experts™
on
I am trying to access PHPMyAdmin and I get this in the error logs when ever I try to open it.  This is a new install so it has never worked.

client denied by server configuration: /usr/share/phpMyAdmin/setup/index.php and it is referencing my IP.

This is the permissions that are on phpmyadmin

drwxr-sr-x 10 ec2-user daemon 4096 Apr 28 20:38 phpmyadmin

PHPMyAdmin is located at /var/www/html/phpmyadmin

I need to be able to get this working so please tell me how to fix the problem.

Thanks,

Randal
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
What Linux distribution are you using?  And which version of phpMyAdmin are you trying to install?
Top Expert 2015

Commented:
Why dont you install RPM package
having phpmyadmin in /phpmyadmin opens you to all sorts of evils of the net
Distinguished Expert 2017

Commented:
Check within phpmyadmin for a .htaccess file.

My guess is that the error relates to the database connection configuration.
Look at /var/log/httpd or /var/log/apache2 in access and error log files to see whether they shed light on the issue.

Did you go through phpmyadmin config?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

As arnold mentioned, there is an htaccess file in your phpmyadmin folder in your web tree, or a <Directory> directive in your httpd.conf referencing that path, and one of them will have a block that looks something like this in it:

<Limit GET>
order deny,allow
deny from all
allow from 127.0.0.1
allow from 10.0.0.1
</Limit>

Open in new window

Be sure that your IP address(es) appear in one of the allow from lines, and if not present add a new line.  BTW, if you have a line that says something like "require valid-user" then you will need to add your username and encrypted password to the file referenced by the AuthUserFile directive in .htaccess

Author

Commented:
The linux distribution is Amazon Linux AMI release 2014.03
Kernel \r on an \m - that's what I get when I cat /etc/issue

The PHPMyAdmin is from yum the epel repository -
phpMyAdmin - Readme
===================

Version 4.1.14

I thought having it installed there was wrong so glad you pointed it out.  I am not familiar with an RPM installation.  

This message is from /var/log/httpd/error_logs
client denied by server configuration: /usr/share/phpMyAdmin/setup/index.php and it is referencing my IP.

I don't see a .htaccess in the phpmyadmin folder

Arnold - don't understand this statement - Did you go through phpmyadmin config?

I went through httpd.conf looking for <Limit, allow from and require valid with the search option in nano.  But none of those are to be found in httpd.conf
Distinguished Expert 2017

Commented:
The restriction might be in /etc/httpd/conf.d
See if your httpd.conf file has an include directive at the bottom of the file
include /etc/httpd/conf.d/*.conf
If it does look within this conf.d directory.
A file here such as phpmyadmin.conf
grep -il phpmy

Phpmyadmin has a configuration file where the login options and the mysql server/s that it can administer are defined.  Look in index.php and it should point to agile using include directive. This may manifest once you correct the access issues.

Presumably you have a centos/redhat .... See if you have /etc/release*
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
Commented:
While Ubuntu Linux could be different than your version, phpMyAdmin installed from the package manager as an Alias in /etc/apache2/conf.d/phpmyadmin.conf .  It is not present in a 'regular' web directory like /var/www/html/phpmyadmin at all.  It is available at 'http://localhost/phpmyadmin/' or by the machine IP adress at 'http://10.10.10.10/phpmyadmin/'.   An Alias lets you use a directory outside your web root as part of the web site.
Distinguished Expert 2017

Commented:
Note the error reflects the path not in /var/www/html/phpmyadmin but in /usr/share/phpmyadmin

You could copy the phpmyadmin from the share location to the HTML directory as phpmyadmin2 to test.  The links within are relative and will work, but I think manual modification might still be needed.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
The new versions of phpMyAdmin that I have manually installed require you to have a writeable directory for the setup procedure after which you are supposed to copy a 'config' file to the main phpMyAdmin directory and make the setup directory un-writeable.  I'm wondering that is what is causing the problem.
I installed the EPEL version of phpMyAdmin on one of my test boxes.  Look in /etc/httpd/conf.d/phpMyAdmin.conf and you will find those Allow/Deny directives I described.  You only need to modify the access levels for the first two Directory blocks.

After you add an Allow from line for your IP, you will need to reload or restart Apache, and then you should be able to access the site.

Author

Commented:
Thanks everyone for your assistance.  Adding in the allow from didn't do it all until I changed the alias.  Now it can be accessed via http://my_ip/phpmyadmin

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial