CentOS7安装phpMyAdmin后缺失phpMyAdmin.conf文件求助
phpMyAdmin.conf After Installation on CentOS 7 Hey there, let's walk through why you're missing the /etc/httpd/conf.d/phpMyAdmin.conf file after installing phpMyAdmin on your Linode CentOS 7 system. Here are the most likely fixes to get you sorted:
1. First, confirm phpMyAdmin actually installed successfully
Sometimes yum installs can fail silently due to missing repos or dependency issues. Let's check if the package is even on your system:
sudo rpm -qa | grep phpMyAdmin
If you get no output, that means the installation didn't complete. CentOS 7's default repos don't include phpMyAdmin, so you need to enable the EPEL repository first, then reinstall:
sudo yum install epel-release -y sudo yum install phpMyAdmin -y
This should pull the full package, including the required Apache config file into /etc/httpd/conf.d/.
2. Check for alternative config file locations
If phpMyAdmin is installed but the conf file isn't in the expected directory, it might be stored in the phpMyAdmin share folder. Try copying the sample Apache config to the correct path:
sudo cp /usr/share/phpMyAdmin/apache.conf /etc/httpd/conf.d/phpMyAdmin.conf
After copying, restart Apache to apply the new config:
sudo systemctl restart httpd
3. Dig into yum logs to track file placements
If you're still stuck, check the yum installation logs to see exactly where phpMyAdmin placed its files. Run this to search the logs:
grep phpMyAdmin /var/log/yum.log
You'll see a list of all files installed with the package. If the config file is in a different directory, you can manually move or link it to /etc/httpd/conf.d/.
4. Match your PHP 7 repo for phpMyAdmin
Since you're running PHP 7 (which isn't in CentOS 7's default repo), if you installed PHP from a third-party source like Remi, you need to install phpMyAdmin from the same repo to ensure compatibility and proper config setup. Enable the correct Remi repo and reinstall:
sudo yum install yum-utils -y sudo yum-config-manager --enable remi-php71 # Adjust to your exact PHP 7.x version sudo yum install phpMyAdmin -y
This should generate the phpMyAdmin.conf file in /etc/httpd/conf.d/ as expected.
内容的提问来源于stack exchange,提问作者Pankaj

