1. apache与php
pacman -S php-apache
(安装apache、php、php扩展:libphp)
mousepad /etc/httpd/conf/httpd.conf
(配置apache——php扩展)
------------------------------
#LoadModule mpm_event_module modules/mod_mpm_event.so(注释)
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
(去掉注释)
.
LoadModule php7_module modules/libphp7.so
AddHandler php7-script php (将这一行放在LoadModule 的末尾)
.
Include conf/extra/php7_module.conf (将这一行放到Include列表的末尾)
------------------------------
使用命令:“php -S localhost:8000 -t public_html/ ”可以独立运行PHP
2. mysql
pacman -S mariadb
(安装mysql数据库)
mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
(mysql目录配置)
systemctl start mysqld
(启动数据库)
mysql_secure_installation
(mysql安全配置)
pacman -S dbeaver
(安装数据库管理工具)
3. phpmyadmin
pacman -S phpmyadmin
(安装phpmyadmin)
mousepad /etc/httpd/conf/extra/phpmyadmin.conf
(创建Apache配置文件)
------------------------------
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
------------------------------
mousepad /etc/httpd/conf/httpd.conf
(将上个文件的引用加入到httpd.conf)
------------------------------
# phpMyAdmin configuration
Include conf/extra/phpmyadmin.conf (将这一行放到Include列表的末尾)
------------------------------
//mousepad /etc/webapps/phpmyadmin/config.inc.php
(配置phpmyadmin)
mousepad /etc/php/php.ini
(配置mysqli 扩展)
------------------------------
extension=mysqli(去掉;注释)
------------------------------
不执行上述操作的话,在进入phpmyadmin时会显示"缺少 mysqli 扩展“