How to install phpmyadmin in archlinux
Summary
Installing software in archlinux is usually simple. You can just type this command sudo pacman -S software and it will do the work. However, setting up phpmyadmin is not that easy.
Just follow this shot step by step.
Installing packages
First! open your terminal and type:
sudo pacman -S phpmyadmin apache php php-apache mariadb gedit
Note: gedit is optional, but install it so that you can follow along with me.
-
Press Enter
-
Enter your password
-
Type
Yand wait for the installation to complete
Setting up PHP
Type this command in the terminal (or just copy paste):
sudo gedit /etc/php/php.ini
You will see something like this:
-
On your keyboard, press
Ctrl+Fand search forextension=mysqli -
Remove the semicolon
;beforeextension=mysqliandextension=pdo_mysql, just like in the picture below
- Press
Ctrl+Fagain, search fordate.timezone, and give it a value, for example :
date.timezone = Europe/Berlin
date.timezone = Africa/Abidjan
You can find the capital of your country in this list
- Search for
display_errorsby pressingCtrl+Fand make its value:
display_errors = On
- Search for
open_basedirand make its value:
open_basedir = /srv/http/:/var/www/:/home/:/tmp/:/var/tmp/:/var/cache/:/usr/share/pear/:/usr/share/webapps/:/etc/webapps/
- Save and close
- In your terminal, type this to edit
httpd.conf:
sudo gedit /etc/httpd/conf/httpd.conf
- Add this at the end:
### PHP Configuration
Include `conf/extra/php7_module.conf`:
- Save and close
Setting up APACHE
- Now, we will create a file called
phpmyadmin.confby typing this command on the terminal:
sudo touch /etc/httpd/conf/extra/phpmyadmin.conf
- Let’s open it by typing:
sudo gedit /etc/httpd/conf/extra/phpmyadmin.conf
- Copy-paste this and save:
Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
DirectoryIndex index.php
AllowOverride All
Options FollowSymlinks
Require all granted
</Directory>
Setting APACHE to use PHP (Using libphp)
- In your terminal, type the following to edit
httpd.conf:
sudo gedit /etc/httpd/conf/httpd.conf
Ctrl+F and search for LoadModule mpm_event_module modules/mod_mpm_event.so
- Comment this line by adding a hashtag
#, like this :
#LoadModule mpm_event_module modules/mod_mpm_event.so
-
Then,
Ctrl+Fand search forLoadModule mpm_prefork_module modules/mod_mpm_prefork.so -
Uncomment this line by removing the hashtag
#, like this :
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
Too much work? We will be done soon.
- Paste this at the end of the LoadModule list, like what you see in the image below:
LoadModule php7_module modules/libphp7.so
AddHandler php7-script .php
- Paste this at the end of the text file:
# phpMyAdmin configuration
Include conf/extra/phpmyadmin.conf
- Save and close
Finishing up
Now, it’s almost done
- Start apache with the following command:
sudo systemctl start httpd
- Start mariadb with this command:
sudo systemctl start mariadb
- Then, type the following in your terminal:
sudo mysql -u root -p
Note: enter any password you want or just leave it empty by pressing
Enter.
- Finall,y set a password for the login dashbord:
SET PASSWORD FOR root@localhost=PASSWORD('2222');.
- Open your favorite browser
http://localhost/phpmyadmin/
username: root
password: 2222