在 Windows 10 中安装 phpMyAdmin 4.8,基于 Composer 安装升级,以避免后续手动安装升级的麻烦

1、参考网址:https://docs.phpmyadmin.net/zh_CN/latest/setup.html#installing-using-composer

2、基于 Composer 安装,运行命令,如图1

基于 Composer 安装,运行命令

图1

composer create-project phpmyadmin/phpmyadmin phpmyadmin-localhost
Installing phpmyadmin/phpmyadmin (4.8.2)
  - Installing phpmyadmin/phpmyadmin (4.8.2): Downloading (connecting...)^CTerminate batch job (Y/N)? Y
PS E:/wwwroot> composer create-project phpmyadmin/phpmyadmin phpmyadmin-localhost
Installing phpmyadmin/phpmyadmin (4.8.2)
  - Installing phpmyadmin/phpmyadmin (4.8.2): Downloading (100%)
Created project in phpmyadmin-localhost
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependenc
ies. Run update to update them.
Package operations: 49 installs, 0 updates, 0 removals

phpmyadmin/phpmyadmin suggests installing ext-opcache (Better performance)
phpmyadmin/phpmyadmin suggests installing ext-gd2 (For image transformations)
phpmyadmin/shapefile suggests installing ext-dbase (For dbf files parsing)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up
 arbitrary precision integer arithmetic operations.)
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodi
um-php extension.)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate ran
dom bytes.)
twig/extensions suggests installing symfony/translation (Allow the time_diff output to be translated)
symfony/console suggests installing psr/log-implementation (For using the console logger)
symfony/console suggests installing symfony/event-dispatcher
phpunit/php-code-coverage suggests installing ext-xdebug (>=2.2.1)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit suggests installing phpunit/php-invoker (~1.1)
Generating autoload files

3、进入 phpmyadmin-localhost 目录,更新 phpMyAdmin 至最新版本,运行命令,如图2

进入 phpmyadmin-localhost 目录,更新 phpMyAdmin 至最新版本,运行命令

图2

composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 7 installs, 19 updates, 1 removal

Writing lock file
Generating autoload files

4、使用安装程序生成配置文件:config.inc.php,打开浏览器并使用 /setup 后缀访问,网址:http://localhost/phpmyadmin-localhost/setup/ ,新建服务器,如图3

使用安装程序生成配置文件:config.inc.php,打开浏览器并使用 /setup 后缀访问,网址:http://localhost/phpmyadmin-localhost/setup/ ,新建服务器

图3

5、点击 应用 按钮后,再点击 下载 按钮,以下载配置文件:config.inc.php,如图4、图5

点击 应用 按钮

图4

点击 下载 按钮,以下载配置文件:config.inc.php

图5

6、复制 config.inc.php 至 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost ,有警告信息:phpMyAdmin 高级功能尚未完全设置,部分功能未激活。查找原因。如图6

复制 config.inc.php 至 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost ,有警告信息:phpMyAdmin 高级功能尚未完全设置,部分功能未激活。查找原因。

图6

7、按照提示:Create a database named ‘phpmyadmin’ and setup the phpMyAdmin configuration storage there.,点击 Create 链接,成功创建数据库:phpmyadmin,回到主页,警告信息已消失,如图7

按照提示:Create a database named 'phpmyadmin' and setup the phpMyAdmin configuration storage there.,点击 Create 链接,成功创建数据库:phpmyadmin,回到主页,警告信息已消失

图7

8、打开网址:https://www.phpmyadmin.net/themes/ ,下载主题:Metro 2.8,复制至 /themes/,切换主题为:Metro,如图8、图9

打开网址:https://www.phpmyadmin.net/themes/ ,下载主题:Metro 2.8

图8

复制至 /themes/,切换主题为:Metro

图9

9、注:主题的安装升级暂时没有法子基于 Composer ,只能够通过下载的方案实现,且基于 Composer 安装升级不能够升级至最新的版本:4.8.3,原因在于 Composer 库的版本更新有所延迟,需要等待。

10、当要增加新的服务器时,需要先删除 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost/setup/ ,新建服务器,如图10

当要增加新的服务器时,需要先删除 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost/setup/ ,新建服务器

图10

11、下载配置文件:config.inc.php,复制 config.inc.php 至 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost ,登录时,选择服务器已经存在2个,可以自行选择登录哪个服务器,如图11

下载配置文件:config.inc.php,复制 config.inc.php 至 /phpmyadmin-localhost/config.inc.php,打开网址:http://localhost/phpmyadmin-localhost ,登录时,选择服务器已经存在2个,可以自行选择登录哪个服务器

图11

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/251018.html

(0)
上一篇 2022年5月1日
下一篇 2022年5月1日

相关推荐

发表回复

登录后才能评论