329 字
2 分钟
Manjaro安装phpmyadmin

1~6 为环境搭建

7~9 为phpmyadmin的正式安装

1.更新系统#

yay -Syu

2.安装Apache#

yay -S apache

借助kate编辑httpd.conf(也可用vi,vim,nano)

kate /etc/httpd/conf/httpd.conf

注释 LoadModule unique_id_module modules/mod_unique_id.so

Screenshot_20220903_231444

设置开机启动,并重新启动服务、检查服务运行状况,保证

systemctl enable httpd
systemctl restart httpd 

​ 正常:Active: active (running)

Screenshot_20220903_231728

​ 异常:Active: failed

Screenshot_20220903_232005

出现这种情况分析最后几行错误提示查找原因,每次修改需执行:

systemctl restart httpd
systemctl status httpd

3.测试Apache#

创建页面

kate /srv/http/index.html

index.html

<html>
 <title>Welcome</title>
  <body>
   <h2>Welcome to OSTechNix test page</h2>
  </body>
</html>

不出意外,出现以下内容:

http://127.0.0.1/

Screenshot_20220903_232840

4.安装测试mariadb#

https://www.kozakemi.top/archives/733

5.安装PHP#

yay -S php php-apache

编辑 httpd.conf

kate /etc/httpd/conf/httpd.conf

Screenshot_20220903_233704

并添加以下内容_(注意,此处内容随PHP版本改变而变化_

本机PHP版本:PHP Version 8.1.9)

LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
LoadModule php_module modules/libphp.so
AddHandler php-script php
Include conf/extra/php_module.conf

Screenshot_20220903_233953

6.测试PHP#

建立测试PHP文件

kate /srv/http/test.php

test.php

<?php
 phpinfo();
?>

重新启动httpd,检查修改是否有误

systemctl restart httpd
systemctl status httpd

如无误:

http://127.0.0.1/test.php

Screenshot_20220903_234529

7.安装phpmyadmin#

yay -S phpmyadmin php-mcrypt

修改php.ini

kate /etc/php/php.ini

php.ini

添加:

extension=mcrypt

修改:取消以下注释:

extension=bz2
extension=mysqli

Screenshot_20220903_235337

配置phpmyadmin

kate /etc/httpd/conf/extra/phpmyadmin.conf

添加以下内容:

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
 <Directory "/usr/share/webapps/phpMyAdmin">
  DirectoryIndex index.php
  AllowOverride All
  Options FollowSymlinks
  Require all granted
 </Directory>

编辑 Apache的配置文件

kate /etc/httpd/conf/httpd.conf

添加:

/etc/httpd/conf/httpd.conf

Screenshot_20220903_235802

再次重新启动httpd,检查修改是否有误

systemctl restart httpd
systemctl status httpd

8.测试phpMyAdmin#

http://127.0.0.1/phpmyadmin/

Screenshot_20220904_000139

输入密码,访问成功:

Screenshot_20220904_000339

Manjaro安装phpmyadmin
https://kozakemi.top/posts/manjaro安装phpmyadmin/
作者
Kozakemi
发布于
2022-09-04
许可协议
CC BY-NC-SA 4.0