insights/content/tutorials/install-php-apache-mysql-phpmyadmin-archlinux/index.md
ditatompel 5d0965673d
chore(i18n): Fix image problems
The images in an Indonesian article are not displayed
if no primary language (in this case, English) is present.
Adding the main primary language fixes the image rendering problem.
2024-06-07 20:12:49 +07:00

2.5 KiB

title description summary date lastmod draft noindex nav_weight series categories tags images authors
Installing PHP, Apache, MySQL, and phpMyAdmin on Arch Linux A step-by-step guide to installing PHP, Apache, MySQL, and phpMyAdmin on Arch Linux. A step-by-step guide to installing PHP, Apache, MySQL, and phpMyAdmin on Arch Linux. 2012-02-18T05:01:30+07:00 false false 1000
SysAdmin
Linux
MySQL
Apache
PHP
ditatompel

Why Arch Linux? Because I'm comfortable using Arch, and with its package manager, we can easily install the latest and most up-to-date kernel and software.

Video (in Indonesian):

{{< youtube zr7TVU7SZUs >}}

  1. First, we ensure that our system is up to date by running:
pacman -Syu
  1. Next, we install the necessary packages using:
pacman -S php apache php-mcrypt phpmyadmin mysql
  1. We then navigate to the /etc/webapps/phpmyadmin directory and copy the phpmyadmin configuration file to /etc/httpd/conf/extra:
cp /etc/webapps/phpmyadmin/apache.example.conf /etc/httpd/conf/extra/httpd-phpmyadmin.conf
  1. We include the configuration in the main httpd.conf file located in the /etc/httpd/conf directory by adding:
# phpmyadmin configuration
Include conf/extra/httpd-phpmyadmin.conf

Apache Config PHPMyAdmin

Then, we can access localhost and phpmyadmin in the browser.

  1. If there is a forbidden message in phpmyadmin, we need to add the DirectoryIndex index.html index.php configuration to /etc/httpd/conf/extra/httpd-phpmyadmin.conf, then restart the http server.

DirectoryIndex Apache

  1. If PhpMyAdmin can be accessed, but there is still an error message "The mysqli extension is missing." or "The mcrypt extension is missing"; We need to enable the extension in php.ini by removing the semicolon (;) from the required extension.

PHP Extension

extension=mcrypt.so
extension=mysqli.so
extension=mysql.so

Then, we can restart the http server again.

FYI: On Arch Linux, by default httpd runs as user http and group http. To make it more comfortable and avoid error messages on certain CMS installations, we need to change the permissions and owner of the /srv/http folder (where the public_html folder is located) using:

chown -R http:http /srv/http

The installation process for Apache, PHP, MySQL, and PhpMyAdmin is now complete.

For now, this concludes the basics.