phpMyAdmin issue after changing httpd.conf DocumentRoot

Hello crew,

For purposes of SSL certificates and DNS redirect, I changed the \xampp\apache\conf\httpd.conf file DocumentRoot from “/xampp/htdocs” to “/xampp/htdocs/openemr”. This works well, allowing for easier internal network access to the EMR.

Once I made this change to the DocumentRoot, I can no longer load phpMyAdmin in OpenEMR, however. When I open it via Administrator/Other/Database, it brings up a blank tab.

Can someone assist me as to where to change the path OpenEMR is using to access phpMyAdmin to correct this?

Thank you for your help!

This is somewhat similar to a previous discussion: $web_root = "openemr" problem

@Davidnic,
Are you able to open PhyMyAdmin outside OpenEMR? For example : http://localhost/phpmyadmin/
Can you please share the error logs.

Thanks,
ViSolve

Thanks for your quick response! I appreciate the help.

If I attempt to access phpMyAdmin directly via localhost/phpmyadmin/ then I get the following error message:

"Welcome to phpMyAdmin

Error
MySQL said: Documentation

Cannot connect: invalid settings.
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server."

This is the case for me even when phpMyAdmin is working in OpenEMR, however. The reason phpMyAdmin is not loading within OpenEMR is that I changed documentroot from “/xampp/htdocs” to “/xampp/htdocs/openemr” in the \xampp\apache\conf\httpd.conf file. When I change documentroot back, the phpMyAdmin will load in OpenEMR again.

I am asking where I need to correct the path called in OpenEMR to the phpMyAdmin to go up a level from the document root of “/xampp/htdocs/openemr” so I can continue to access phpMyAdmin through OpenEMR.

Best,
Dave

@Davidnic,
Edit the config.inc.php and try by changing the below configurations.
$cfg[‘Servers’][$i][‘password’] = ‘’; to $cfg[‘Servers’][$i][‘password’] = ‘yourPassHere’;
You can find the file under “xampp\phpmyadmin”

Also please refer the below link

Thanks,
ViSolve

1 Like

Something tells me you may be on a version of OpenEMR prior to v5.0.0(phpmyadmin removed from app tree). Prior versions start from the left nav where the link is hard coded thus: …/phpmyadmin/index.php so by changing document root to alias directly into openemr directory then url can’t find phpmyadmin config. You may be able to setup a directory alias in your httpd config(or virtual host) to allow access to openemr/phpmyadmin directory. However, I tend to miss the point of forum questions occasionally so ignore if I missed it here.:slight_smile:

Hi sjpadgett, I should have mentioned that in my post; I am on a Windows Server platform with the OpenEMR 5.0.0 (7) XAMPP Package installation. I think you are correct that changing document root to alias directly into openemr directory then the url can’t find phpmyadmin config. I’ll take a look at the index.php file. Thank you!

Just realized v5.0.0 still has phpmyadmin (removed in upcoming release…duh). I just can’t remember if I had this issue as I use to alias into openemr root. Don’t think the index file is going to tell you much. Can you right click the link and open in a new tab then tell me what the url is?

As best as I can tell from the page source, the admin/other/database link is calling the index.php file:

{“label”:“Database”,“menu_id”:“dba0”,“target”:“dba”,“url”:"/phpmyadmin/index.php",“children”:[],“requirement”:0,“acl_req”:[“admin”,“database”],“global_req”:"!disable_phpmyadmin_link"},

Hi David, Let me check this out today and i’ll get back to ya. Kinda myth’ed by pathing in code and may be a bug but I can’t imagine this hasn’t come up before. No worries, tho.

@Davidnic Okay, looks like it is the server that is thinking the database link is cross origin. add the following directive to your httpd or virtual host: Header set X-Frame-Options SAMEORIGIN

Restart apache and you should be good to go. Good luck.

@sjpadgett that works. Thank you for your help!

You bet.