大网数据广告活动
服务器运维问答

PhpMyAdmin do not update correctly (AWS - EC2)

· 52CE 我爱测

I have tried to install and/or updated phpMyAdmin three times under a Linux Amazon AMI image with Apache server in Amazon EC2, and I don't get to have the last version installed. This is what I have done to install version 4.1.14…

问题原文

原帖链接 · villamejia · CC BY-SA 3.0

I have tried to install and/or updated phpMyAdmin three times under a Linux Amazon AMI image with Apache server in Amazon EC2, and I don't get to have the last version installed.

This is what I have done to install version 4.1.14:

  1. cd /var/www/html
  2. wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.1.14/phpMyAdmin-4.1.14-all-languages.tar.gz
  3. tar -xzvf phpMyAdmin-4.1.14-all-languages.tar.gz -C /var/www/html
  4. mv phpMyAdmin-4.1.14-all-languages phpmyadmin
  5. rm -rf phpMyAdmin-4.1.14-all-languages.tar.gz
  6. adduser phpmyadmin
  7. passwd phpmyadmin
  8. chown -R phpmyadmin.apache phpmyadmin/
  9. cd phpmyadmin
  10. mkdir config
  11. chmod o+rw config
  12. sudo cp config.sample.inc.php config/config.inc.php

    Note: Before re-installing I copy the config.inc.php in a directory,and after the installation I restore it from /config.inc.php config/config.inc.php) sudo chmod o+w config/config.inc.php service

  13. httpd restart

When opening http:///phpmyadmin/, I'm always getting: Version 2.11.11.3 and an old style main page of phpmyadmin.

How can I update phpMyAdmin to the last version (in this case, 4.1.14, last stable version)?

已采纳解答

原帖链接 · Giacomo1968 · CC BY-SA 4.0

The original poster shared this Apache config this in the comments:

<Directory "/usr/share/phpmyadmin">
# Order Deny,Allow
# Deny from all Allow from 127.0.0.1
</Directory>
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

That’s your problem. You are trying to install phpMyAdmin manually in the main /var/www/html directory. But this Apache config has three aliases that would override that. The phpMyAdmin in /usr/share/phpmyadmin is actually the standard RPM package install location.

So if you want to you can just comment out those Alias lines like this. Heck, comment out the <Directory> stuff as well:

# <Directory "/usr/share/phpmyadmin">
# Order Deny,Allow
# Deny from all Allow from 127.0.0.1
# </Directory>
# Alias /phpmyadmin /usr/share/phpmyadmin
# Alias /phpMyAdmin /usr/share/phpmyadmin
# Alias /mysqladmin /usr/share/phpmyadmin

Restart Apache and then go to your URL of:

http://the_url_of_your_site/phpmyadmin/

And now the upgraded version you installed should load as expected.

The other alternative is to rename /var/www/html/phpmyadmin to something like /var/www/html/phpmyadmin4 to get around that Alias. But you don’t need the Alias if you are installing directly into the web root of your server.

EDIT: And if you want to upgrade the version of phpmyadmin in /usr/share, then keep those Alias directives in place but use the following modified instructions. Please double-check these before running:

  1. cd /usr/share
  2. sudo mv phpmyadmin phpmyadmin-OLD NOTE: This is a backup of your old phpmyadmin just in case. Feel free to delete this phpmyadmin-OLD when you are sure you are in good shape with the new phpmyadmin.
  3. sudo wget https://files.phpmyadmin.net/phpMyAdmin/4.9.1/phpMyAdmin-4.9.1-all-languages.tar.gz
  4. sudo tar -xzvf phpMyAdmin-4.9.1-all-languages.tar.gz -C /usr/share
  5. sudo mv phpMyAdmin-4.9.1-all-languages phpmyadmin
  6. sudo rm phpMyAdmin-4.9.1-all-languages.tar.gz
  7. sudo adduser phpmyadmin
  8. sudo passwd phpmyadmin
  9. sudo chown -R phpmyadmin:apache phpmyadmin/
  10. cd phpmyadmin
  11. mkdir config
  12. chmod o+rw config
  13. sudo cp config.sample.inc.php config/config.inc.php NOTE: Before re-installing I copy the config.inc.php in a directory,and after the installation I restore it from /config.inc.php config/config.inc.php) sudo chmod o+w config/config.inc.php service
  14. sudo httpd restart

Just please note, there are a few things that are “wonky” but not dangerous about your instructions. For example, there was no sudo set before many commands. Maybe that was because it was in /var/www/html but I added sudo. Also your chown was 100% wrong with chown -R phpmyadmin.apache when that should be chown -R phpmyadmin:apache.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2014-05-09)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0 / CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。